This commit is contained in:
j 2017-02-23 16:32:52 +01:00
parent 5947f2295b
commit 50bb40291c

View file

@ -48,9 +48,8 @@ class Item(models.Model):
return False
self.data[key] = data[key]
if key == 'contentid':
try:
content = self.get_content()
except:
if not content:
return False
changed = True
if 'type' in data:
@ -101,6 +100,7 @@ class Item(models.Model):
return None
data = None
content = None
try:
if type == 'list':
content = List.get(contentid)
data = content.json(keys=content_keys)
@ -113,6 +113,8 @@ class Item(models.Model):
content = Collection.get(contentid)
data = content.json(keys=content_keys)
data['link'] = '/documents/collection==' + quote(data['user'] + ':' + data['name'])
except:
return None
if content and content.status == 'private':
self.delete()
data = None