Skip to content

Commit

Permalink
Check for existing slugs case-insensitively
Browse files Browse the repository at this point in the history
When we check if a proposed slug is already taken, make sure not to
ignore case, so if 'eduskunta' is already taken, and someone asks for
'eDuSkUnTa', don’t let them proceed.
  • Loading branch information
tmtmtmtm committed Apr 16, 2015
1 parent e1ddc39 commit d175ddb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nuntium/user_section/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def clean_slug(self):
url_validator = validators.URLValidator(message="Enter a valid subdomain")
url = 'http://%s.example.com' % slug
url_validator(url)
slug_exists = WriteItInstance.objects.filter(slug=slug).exists()
slug_exists = WriteItInstance.objects.filter(slug__iexact=slug).exists()
if slug_exists:
raise ValidationError(_("This subdomain has already been taken."))
return slug
Expand Down

0 comments on commit d175ddb

Please sign in to comment.