Skip to content

Commit

Permalink
fix(mtd): retrieve af even if actors association impossible
Browse files Browse the repository at this point in the history
Commit the retrieval of an acquisition framework to the database before processing the retrieval and association of its actors, i.e. the execution of `associate_actors`.
This prevents the retrieval of the AF not be to committed in the case there happen to be issues in the execution of `associate_actors`
  • Loading branch information
VincentCauchois committed Oct 31, 2024
1 parent e34ce99 commit aeed4c6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/geonature/core/gn_meta/mtd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ def process_af_and_ds(af_list, ds_list, id_role=None):
add_unexisting_digitizer(af["id_digitizer"] if not id_role else id_role)
user_add_total_time += time.time() - start_add_user_time
af = sync_af(af)
# Commit here to retrieve the AF even if the association of actors that follows is to fail
db.session.commit()
# If the AF has not been retrieved, associated actors cannot be retrieved either
# and thus we continue to the next AF
if not af:
Expand Down

0 comments on commit aeed4c6

Please sign in to comment.