mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
removed unnecessary 'date_obj_to_timestamp'
This commit is contained in:
parent
46f05968bc
commit
25a0e64a06
1 changed files with 1 additions and 10 deletions
|
|
@ -59,7 +59,7 @@ class PublishReportItem:
|
|||
created_at_obj = datetime.datetime.strptime(
|
||||
content["created_at"], "%Y-%m-%d %H:%M:%S"
|
||||
)
|
||||
created_at = self.date_obj_to_timestamp(created_at_obj)
|
||||
created_at = created_at_obj.timestamp()
|
||||
|
||||
self.content = content
|
||||
self.report_path = report_path
|
||||
|
|
@ -201,15 +201,6 @@ class PublishReportItem:
|
|||
self.content = content
|
||||
self.file_modified = file_modified
|
||||
|
||||
@staticmethod
|
||||
def date_obj_to_timestamp(date_obj):
|
||||
if hasattr(date_obj, "timestamp"):
|
||||
return date_obj.timestamp()
|
||||
|
||||
# Python 2 support
|
||||
epoch = datetime.datetime.fromtimestamp(0)
|
||||
return (date_obj - epoch).total_seconds()
|
||||
|
||||
@classmethod
|
||||
def _fix_content(cls, content, file_modified=None):
|
||||
"""Fix content for backward compatibility of older report items.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue