Skip to content

Commit

Permalink
Allow setting an org's name if previously unset (#1892)
Browse files Browse the repository at this point in the history
  • Loading branch information
jace authored Oct 9, 2023
1 parent d2e7772 commit 2c765b9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions funnel/forms/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ def validate_name(self, field: forms.Field) -> None:
)
if reason == 'reserved':
raise forms.validators.ValidationError(_("This name is reserved"))
if self.edit_obj and field.data.lower() == self.edit_obj.name.lower():
# Name is not reserved or invalid under current rules. It's also not changed
# from existing name, or has only changed case. This is a validation pass.
if (
self.edit_obj
and self.edit_obj.name
and field.data.lower() == self.edit_obj.name.lower()
):
# Name has only changed case from previous name. This is a validation pass
return
if reason == 'user':
if (
Expand Down

0 comments on commit 2c765b9

Please sign in to comment.