From 54a7e8d4271f9a34f791097ac1d5a99c0fe96d56 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Wed, 21 Jul 2010 14:38:02 -0400 Subject: [PATCH] Redirect for invalid tags too (just don't manipulate the data) --- cookbook/server.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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) -- 2.26.2