on utilise la date fournie par le json comme date de dernière modification
This commit is contained in:
parent
159e47dff3
commit
8e6622c178
@ -251,6 +251,7 @@ class Event(models.Model):
|
||||
self.created_date = now
|
||||
if hasattr(self, "require_imported_date"):
|
||||
self.imported_date = now
|
||||
if not hasattr(self, "require_imported_date") or self.modified_date is None:
|
||||
self.modified_date = now
|
||||
|
||||
|
||||
@ -294,10 +295,10 @@ class Event(models.Model):
|
||||
del event_structure["url_human"]
|
||||
|
||||
if "last_modified" in event_structure and event_structure["last_modified"] is not None:
|
||||
event_structure["created_date"] = event_structure["last_modified"]
|
||||
event_structure["modified_date"] = event_structure["last_modified"]
|
||||
del event_structure["last_modified"]
|
||||
else:
|
||||
event_structure["created_date"] = timezone.now()
|
||||
event_structure["created_date"] = None
|
||||
|
||||
if "start_time" in event_structure:
|
||||
event_structure["start_time"] = time.fromisoformat(event_structure["start_time"])
|
||||
|
Loading…
Reference in New Issue
Block a user