On vire les trucs de logs à la con
This commit is contained in:
parent
71cfe1b130
commit
bdcb27d473
@ -1644,19 +1644,15 @@ class Event(models.Model):
|
||||
if event.uuids and len(event.uuids) > 0:
|
||||
uuids |= set(event.uuids)
|
||||
|
||||
logger.warning("aaaa2 >>>f")
|
||||
|
||||
# imported events should be updated
|
||||
event.set_in_importation_process()
|
||||
event.set_processing_user(user)
|
||||
event.prepare_save()
|
||||
logger.warning("aaaa3 >>>f")
|
||||
|
||||
# check if the event has already be imported (using uuid)
|
||||
same_events = event.find_same_events_by_uuid()
|
||||
|
||||
if len(same_events) != 0:
|
||||
logger.warning("aaaa4 >>>f")
|
||||
# check if one event has been imported and not modified in this list
|
||||
same_imported = Event.find_last_pure_import(same_events)
|
||||
pure = True
|
||||
@ -1668,9 +1664,7 @@ class Event(models.Model):
|
||||
pure = False
|
||||
break
|
||||
|
||||
logger.warning("aaaa5 >>>f")
|
||||
if same_imported:
|
||||
logger.warning("aaaa6 >>>f")
|
||||
# reopen DuplicatedEvents if required
|
||||
if not event.similar(same_imported, False) and same_imported.other_versions:
|
||||
if same_imported.status != Event.STATUS.TRASH:
|
||||
@ -1689,7 +1683,6 @@ class Event(models.Model):
|
||||
same_imported.save(update_fields=["local_image"])
|
||||
to_update.append(same_imported)
|
||||
else:
|
||||
logger.warning("aaaa7 >>>f")
|
||||
# otherwise, the new event possibly a duplication of the remaining others.
|
||||
|
||||
# check if it should be published
|
||||
@ -1712,7 +1705,6 @@ class Event(models.Model):
|
||||
# import this new event
|
||||
to_import.append(event)
|
||||
|
||||
logger.warning("aaaa666 >>>f")
|
||||
for e in to_import:
|
||||
if e.is_event_long_duration():
|
||||
e.status = Event.STATUS.DRAFT
|
||||
@ -1733,14 +1725,12 @@ class Event(models.Model):
|
||||
msg = ti.get_message()
|
||||
msg.related_event = i
|
||||
msg.save()
|
||||
logger.warning("bbbbbb >>>f")
|
||||
|
||||
nb_updated = Event.objects.bulk_update(
|
||||
to_update,
|
||||
fields=Event.data_fields(no_m2m=True)
|
||||
+ ["imported_date", "modified_date", "uuids", "status", "import_sources"],
|
||||
)
|
||||
logger.warning("ccccccc >>>f")
|
||||
|
||||
nb_draft = 0
|
||||
if remove_missing_from_source is not None and max_date is not None:
|
||||
@ -1774,7 +1764,6 @@ class Event(models.Model):
|
||||
to_draft.append(e)
|
||||
|
||||
nb_draft = Event.objects.bulk_update(to_draft, fields=["status"])
|
||||
logger.warning("dddddd >>>f")
|
||||
|
||||
return imported, nb_updated, nb_draft
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user