From: W. Trevor King Date: Wed, 21 Jul 2010 18:38:02 +0000 (-0400) Subject: Redirect for invalid tags too (just don't manipulate the data) X-Git-Tag: v0.1~15 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=54a7e8d4271f9a34f791097ac1d5a99c0fe96d56;p=cookbook.git Redirect for invalid tags too (just don't manipulate the data) --- diff --git a/cookbook/server.py b/cookbook/server.py index 4eda91a..d606414 100644 --- a/cookbook/server.py +++ b/cookbook/server.py @@ -78,9 +78,7 @@ class Server (object): if recipe.tags == None: recipe.tags = [] tag = self._clean_tag(tag) - if tag == None: - return - if tag not in recipe.tags: + if tag != None and tag not in recipe.tags: recipe.tags.append(tag) with open(recipe.path, 'w') as f: recipe.save(f) @@ -96,9 +94,7 @@ class Server (object): if recipe.tags == None: return tag = self._clean_tag(tag) - if tag == None: - return - if tag in recipe.tags: + if tag != None and tag in recipe.tags: recipe.tags.remove(tag) with open(recipe.path, 'w') as f: recipe.save(f)