From fae4c7005079b2711ad2179dedc437e70bfb5871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sun, 18 Jun 2017 16:10:00 +0200 Subject: [PATCH] allow obj_pk on Changes with action=create --- src/c3nav/editor/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/c3nav/editor/models.py b/src/c3nav/editor/models.py index 37582913..7fdf66f2 100644 --- a/src/c3nav/editor/models.py +++ b/src/c3nav/editor/models.py @@ -331,6 +331,8 @@ class Change(models.Model): return self.existing_object_pk if self.created_object_id is not None: return 'c'+str(self.created_object_id) + if self.action == 'create': + return 'c' + str(self.pk) raise TypeError('existing_model_pk or created_object have to be set.') @property