Skip to content

Commit

Permalink
Fix tests failing
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin J. Laubach committed Sep 10, 2024
1 parent ab5e3b8 commit 38b041b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion form_designer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def validate_comma_separated_emails(value):
validate_email(v.strip())

def email_field_choices(form: forms.ModelForm | None, required: bool=True) -> list[tuple[str, str]]:
if not form:
if not form or not form.instance or not form.instance.pk:
return []
email_fields = form.instance.fields.filter(type='email')
choices = [] if required else [('', '--')]
Expand Down

0 comments on commit 38b041b

Please sign in to comment.