Skip to content

Commit

Permalink
empêche le tag vide
Browse files Browse the repository at this point in the history
  • Loading branch information
artragis committed Apr 18, 2016
1 parent 73ba63d commit 778395f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zds/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class Meta:

class TagManager(models.Manager):
def get_from_title(self, title):
if len(slugify(title.strip())) < 1:
if not title.strip() or not slugify(title.strip().replace("-", "")):
raise ValueError('tag "{}" is not correct'.format(title))
current_tag = self.filter(title=title).first()
if current_tag is None:
Expand Down

0 comments on commit 778395f

Please sign in to comment.