Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove checks for IRC channel names in use by other teams. #1407

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/teams/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,42 +195,6 @@ def clean(self):
):
raise ValidationError("The private IRC channel name is reserved")

# make sure public_irc_channel_name is not in use as public or private irc channel for another team, case insensitive
if self.public_irc_channel_name:
if (
Team.objects.filter(
private_irc_channel_name__iexact=self.public_irc_channel_name,
)
.exclude(pk=self.pk)
.exists()
or Team.objects.filter(
public_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 on another team!",
)

# make sure private_irc_channel_name is not in use as public or private irc channel for another team, case insensitive
if self.private_irc_channel_name:
if (
Team.objects.filter(
private_irc_channel_name__iexact=self.private_irc_channel_name,
)
.exclude(pk=self.pk)
.exists()
or 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 on another team!",
)

@property
def memberships(self):
"""
Expand Down