Skip to content

Commit

Permalink
Update managers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
geobrun authored and Chatewgne committed Jan 5, 2024
1 parent 32efd71 commit 148ff82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geotrek/tourism/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ def has_content_published_not_deleted_in_list(self, list_index, category=None, p
q_category = Q(**{category_field_name: category})

if language:
published_field_name = f"contents{i}__published_{language}"
published_field_name = f"contents{i}__published_{language.replace('-', '_')}"
q_lang = Q(**{published_field_name: True})
else:
q_lang = Q()
for lang in settings.MODELTRANSLATION_LANGUAGES:
published_field_name = f"contents{i}__published_{lang}"
published_field_name = f"contents{i}__published_{lang.replace('-', '_')}"
q_lang |= Q(**{published_field_name: True})

deleted_field_name = f"contents{i}__deleted"
Expand Down

0 comments on commit 148ff82

Please sign in to comment.