Skip to content

Commit

Permalink
🐛 [BUG] Fix Aggregator fails when updating Tour steps order (refs #3793)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chatewgne committed Oct 9, 2023
1 parent aa2fae5 commit e23985e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ CHANGELOG
2.101.1+dev (XXXX-XX-XX)
------------------------

**Bug fixes**

- Fix Aggregator fails when updating Tour steps order (#3793)


2.101.1 (2023-10-06)
------------------------

Expand Down
6 changes: 3 additions & 3 deletions geotrek/trekking/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ def end(self):
except Trek.DoesNotExist:
self.add_warning(_(f"One trek has not be generated for {trek_parent_instance[0].name} : could not find trek with UUID {child}"))
continue
OrderedTrekChild.objects.get_or_create(parent=trek_parent_instance[0],
child=trek_child_instance,
order=order)
OrderedTrekChild.objects.update_or_create(parent=trek_parent_instance[0],
child=trek_child_instance,
defaults={'order': order})
order += 1
except Exception as e:
self.add_warning(_(f"An error occured in children generation : {getattr(e, 'message', repr(e))}"))
Expand Down

0 comments on commit e23985e

Please sign in to comment.