mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
more human datetimes
This commit is contained in:
parent
4dbf87da56
commit
c7a077fb33
@ -5,6 +5,7 @@ import logging
|
||||
import os
|
||||
import subprocess
|
||||
import inspect
|
||||
from datetime import datetime
|
||||
|
||||
from django.conf.urls import url, include
|
||||
from django.conf import settings
|
||||
@ -301,6 +302,8 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
||||
name = getattr(self, 'PUBLISH_DATE', None)
|
||||
if not name:
|
||||
name = self.commit.get('date')
|
||||
else:
|
||||
name = datetime.fromisoformat(name)
|
||||
if not name:
|
||||
name = _('No date found')
|
||||
return name
|
||||
@ -339,6 +342,10 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
|
||||
self.commit = commit
|
||||
self.sign_state = sign_state
|
||||
|
||||
# process date
|
||||
if self.commit['date']:
|
||||
self.commit['date'] = datetime.fromisoformat(self.commit['date'])
|
||||
|
||||
if sign_state.status == 0:
|
||||
self.sign_color = 'success'
|
||||
elif sign_state.status == 1:
|
||||
|
Loading…
Reference in New Issue
Block a user