sql: use last_update_time from database (#76003)
gitea/wcs/pipeline/head This commit looks good
Details
gitea/wcs/pipeline/head This commit looks good
Details
This commit is contained in:
parent
dc3a8688d9
commit
117a727c7e
|
@ -1287,6 +1287,8 @@ class FormData(StorableObject):
|
|||
return self.receipt_time
|
||||
|
||||
def set_last_update_time(self, value):
|
||||
if isinstance(value, datetime.datetime):
|
||||
value = value.timetuple()
|
||||
self._last_update_time = value
|
||||
|
||||
last_update_time = property(get_last_update_time, set_last_update_time)
|
||||
|
|
|
@ -2667,6 +2667,10 @@ class SqlDataMixin(SqlMixin):
|
|||
'workflow_merged_roles_dict': self.workflow_merged_roles_dict,
|
||||
'statistics_data': self.statistics_data or {},
|
||||
}
|
||||
if self._evolution is not None and hasattr(self, '_last_update_time'):
|
||||
# if evolution was loaded it may have been been modified, and last update time
|
||||
# should then be refreshed.
|
||||
delattr(self, '_last_update_time')
|
||||
if self.last_update_time:
|
||||
sql_dict['last_update_time'] = datetime.datetime.fromtimestamp(time.mktime(self.last_update_time))
|
||||
else:
|
||||
|
@ -2901,7 +2905,6 @@ class SqlDataMixin(SqlMixin):
|
|||
for field in extra_fields:
|
||||
coldata, i = cls._col2obdata(row, i, field)
|
||||
o.data.update(coldata)
|
||||
del o._last_update_time
|
||||
return o
|
||||
|
||||
@classmethod
|
||||
|
|
Loading…
Reference in New Issue