mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 15:53:28 +00:00
change last_modified to BigInteger
This commit is contained in:
@@ -42,7 +42,7 @@ class FileContributors(models.Model):
|
||||
file_path = models.TextField()
|
||||
file_path_hash = models.CharField(max_length=12)
|
||||
|
||||
last_modified = models.IntegerField()
|
||||
last_modified = models.BigIntegerField()
|
||||
|
||||
# email addresses seperated by comma
|
||||
emails = models.TextField()
|
||||
|
@@ -81,7 +81,7 @@ def translate_commit_desc(value):
|
||||
def translate_commit_time(value):
|
||||
"""Translate commit time to human frindly format instead of timestamp"""
|
||||
|
||||
if type(value) == type(1): # check whether value is int
|
||||
if isinstance(value, int) or isinstance(value, long): # check whether value is int
|
||||
val = datetime.fromtimestamp(value)
|
||||
elif isinstance(value, datetime):
|
||||
val = datetime.fromtimestamp(int(value.strftime("%s")))
|
||||
|
Reference in New Issue
Block a user