fix home
This commit is contained in:
parent
5947f2295b
commit
50bb40291c
1 changed files with 17 additions and 15 deletions
|
@ -48,9 +48,8 @@ class Item(models.Model):
|
||||||
return False
|
return False
|
||||||
self.data[key] = data[key]
|
self.data[key] = data[key]
|
||||||
if key == 'contentid':
|
if key == 'contentid':
|
||||||
try:
|
|
||||||
content = self.get_content()
|
content = self.get_content()
|
||||||
except:
|
if not content:
|
||||||
return False
|
return False
|
||||||
changed = True
|
changed = True
|
||||||
if 'type' in data:
|
if 'type' in data:
|
||||||
|
@ -101,6 +100,7 @@ class Item(models.Model):
|
||||||
return None
|
return None
|
||||||
data = None
|
data = None
|
||||||
content = None
|
content = None
|
||||||
|
try:
|
||||||
if type == 'list':
|
if type == 'list':
|
||||||
content = List.get(contentid)
|
content = List.get(contentid)
|
||||||
data = content.json(keys=content_keys)
|
data = content.json(keys=content_keys)
|
||||||
|
@ -113,6 +113,8 @@ class Item(models.Model):
|
||||||
content = Collection.get(contentid)
|
content = Collection.get(contentid)
|
||||||
data = content.json(keys=content_keys)
|
data = content.json(keys=content_keys)
|
||||||
data['link'] = '/documents/collection==' + quote(data['user'] + ':' + data['name'])
|
data['link'] = '/documents/collection==' + quote(data['user'] + ':' + data['name'])
|
||||||
|
except:
|
||||||
|
return None
|
||||||
if content and content.status == 'private':
|
if content and content.status == 'private':
|
||||||
self.delete()
|
self.delete()
|
||||||
data = None
|
data = None
|
||||||
|
|
Loading…
Reference in a new issue