Skip to content

Commit

Permalink
Normalize committee names before uniqueness check
Browse files Browse the repository at this point in the history
  • Loading branch information
aviupadhyayula committed Jan 23, 2025
1 parent b4d778e commit 47f723a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/clubs/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,8 @@ def save(self):
)

# Committee names must be unique
if len(set(committees)) != len(committees):
normalized_committees = [name.strip().lower() for name in committees]
if len(set(normalized_committees)) != len(normalized_committees):
raise serializers.ValidationError("Committee names must be unique")

if prev_committee_names != committees:
Expand Down

0 comments on commit 47f723a

Please sign in to comment.