Browse Source

HUE-8389 [frontend] fix last_modified timestamp in desktop/models

(cherry picked from commit e2b81a24c89085386d764cd1a47ed212d0b55d87)
Prakash Ranade 7 years ago
parent
commit
32e843a809
1 changed files with 2 additions and 2 deletions
  1. 2 2
      desktop/core/src/desktop/models.py

+ 2 - 2
desktop/core/src/desktop/models.py

@@ -1188,8 +1188,8 @@ class Document2(models.Model):
       'parent_uuid': self.parent_directory.uuid if self.parent_directory else None,
       'type': self.type,
       'perms': self._massage_permissions(),
-      'last_modified': self.last_modified.strftime(UTC_TIME_FORMAT),
-      'last_modified_ts': calendar.timegm(self.last_modified.utctimetuple()),
+      'last_modified': self.last_modified.strftime(UTC_TIME_FORMAT) if self.last_modified else None,
+      'last_modified_ts': calendar.timegm(self.last_modified.utctimetuple()) if self.last_modified else None,
       'is_managed': self.is_managed,
       'isSelected': False,
       'absoluteUrl': self.get_absolute_url(),