Add admin validation ensuring that Partners set to the Codes or Link access methods have user_instructions
@@ -431,6 +431,9 @@ class Partner(models.Model):
if validation_error_msg:
raise ValidationError({"target_url": validation_error_msg})
+ if self.CODES or self.LINK and not self.user_instructions:
+ raise ValidationError('Partners with automatically sent messages require user instructions to be entered')
+
def get_absolute_url(self):
return reverse_lazy("partners:detail", kwargs={"pk": self.pk})
