Commit eed5957e authored by Janez K's avatar Janez K

bugfix

parent 7db8d188
...@@ -52,7 +52,7 @@ class Category(models.Model): ...@@ -52,7 +52,7 @@ class Category(models.Model):
def update_uid(self): def update_uid(self):
import uuid import uuid
if self.uid == '' or self.uid is None: if self.uid == '' or self.uid is None:
self.uid = uuid.uuid4() self.uid = str(uuid.uuid4())
self.save() self.save()
if self.parent: if self.parent:
self.parent.update_uid() self.parent.update_uid()
...@@ -490,16 +490,16 @@ class AbstractWidget(models.Model): ...@@ -490,16 +490,16 @@ class AbstractWidget(models.Model):
def update_uid(self): def update_uid(self):
import uuid import uuid
if self.uid == '' or self.uid is None: if self.uid == '' or self.uid is None:
self.uid = uuid.uuid4() self.uid = str(uuid.uuid4())
self.save() self.save()
for i in self.inputs.filter(uid=''): for i in self.inputs.filter(uid=''):
i.uid = uuid.uuid4() i.uid = str(uuid.uuid4())
i.save() i.save()
for option in i.options.filter(uid=''): for option in i.options.filter(uid=''):
option.uid = uuid.uuid4() option.uid = str(uuid.uuid4())
option.save() option.save()
for o in self.outputs.filter(uid=''): for o in self.outputs.filter(uid=''):
o.uid = uuid.uuid4() o.uid = str(uuid.uuid4())
o.save() o.save()
self.category.update_uid() self.category.update_uid()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment