From 1b9566ee02c939d022c2dd8eb7d8c5332d593e27 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Sat, 19 Jan 2019 13:49:51 +0100 Subject: [PATCH] make channel uniqueness check case insensitive --- src/teams/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/teams/models.py b/src/teams/models.py index 1dbfae99..f9341ace 100644 --- a/src/teams/models.py +++ b/src/teams/models.py @@ -149,12 +149,12 @@ class Team(CampRelatedModel): # make sure public_irc_channel_name is unique if self.public_irc_channel_name: - if Team.objects.filter(private_irc_channel_name=self.public_irc_channel_name).exclude(pk=self.pk).exists(): + if Team.objects.filter(private_irc_channel_name__iexact=self.public_irc_channel_name).exclude(pk=self.pk).exists(): raise ValidationError('The public IRC channel name is already in use!') # make sure private_irc_channel_name is unique if self.private_irc_channel_name: - if Team.objects.filter(public_irc_channel_name=self.private_irc_channel_name).exclude(pk=self.pk).exists(): + if Team.objects.filter(public_irc_channel_name__iexact=self.private_irc_channel_name).exclude(pk=self.pk).exists(): raise ValidationError('The private IRC channel name is already in use!') @property