dont fail if sort is not set
This commit is contained in:
parent
0d21708ce1
commit
5bd36539f0
1 changed files with 6 additions and 2 deletions
|
@ -506,8 +506,12 @@ class Item(models.Model):
|
|||
if key not in i:
|
||||
value = self.get(key)
|
||||
#also get values from sort table, i.e. numberof values
|
||||
if not value and self.sort and hasattr(self.sort, key):
|
||||
value = getattr(self.sort, key)
|
||||
if not value:
|
||||
try:
|
||||
if self.sort and hasattr(self.sort, key):
|
||||
value = getattr(self.sort, key)
|
||||
except ItemSort.DoesNotExist:
|
||||
pass
|
||||
if value:
|
||||
i[key] = value
|
||||
|
||||
|
|
Loading…
Reference in a new issue