dont fail if item has no user

This commit is contained in:
j 2012-02-20 14:39:30 +00:00
parent c49cc47c3d
commit fba62c15f4

View file

@ -577,7 +577,8 @@ class Item(models.Model):
save(i, save(i,
'\n'.join([f.path for f in self.files.all()])) '\n'.join([f.path for f in self.files.all()]))
elif i == 'user': elif i == 'user':
save(i, self.user.username) if self.user:
save(i, self.user.username)
elif key['id'] == 'annotations': elif key['id'] == 'annotations':
qs = Annotation.objects.filter(item=self) qs = Annotation.objects.filter(item=self)
qs = qs.filter(layer__in=Annotation.public_layers()) qs = qs.filter(layer__in=Annotation.public_layers())