From f5bb7b572b45cfb1963bb38dc468d7e24da10749 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 30 Aug 2011 17:26:20 +0530 Subject: [PATCH] ignore tags on delete --- cgi-bin/webnotes/widgets/tags.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cgi-bin/webnotes/widgets/tags.py b/cgi-bin/webnotes/widgets/tags.py index b5e0e32e10..6fe4b1950c 100644 --- a/cgi-bin/webnotes/widgets/tags.py +++ b/cgi-bin/webnotes/widgets/tags.py @@ -70,7 +70,7 @@ class DocTags: def get_tags(self, dn): """returns tag for a particular item""" - return webnotes.conn.get_value(self.dt, dn, '_user_tags') or '' + return webnotes.conn.get_value(self.dt, dn, '_user_tags', ignore=1) or '' def create(self, tag): try: @@ -117,6 +117,10 @@ class DocTags: (self.dt,'%s','%s'), (tags , dn)) except Exception, e: if e.args[0]==1054: + if not tags: + # no tags, nothing to do + return + self.setup() self.update(dn, tl) else: raise e