From 7ab671fea7fda45be5994d85378bfb326eddd7fb Mon Sep 17 00:00:00 2001 From: Anler Hp Date: Mon, 23 Jun 2014 12:11:02 +0200 Subject: [PATCH] Fix invalid use of F() when creating user story --- taiga/projects/occ/mixins.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/taiga/projects/occ/mixins.py b/taiga/projects/occ/mixins.py index 727e57e6..e10bf386 100644 --- a/taiga/projects/occ/mixins.py +++ b/taiga/projects/occ/mixins.py @@ -31,7 +31,9 @@ class OCCResourceMixin(object): if current_version != param_version: raise exc.WrongArguments({"version": "The version doesn't match with the current one"}) - obj.version = models.F('version') + 1 + if obj.id: + obj.version = models.F('version') + 1 + super().pre_save(obj)