Skip to content

Commit

Permalink
Fall back to event locale, not "en"
Browse files Browse the repository at this point in the history
  • Loading branch information
rixx committed Feb 13, 2024
1 parent da9584d commit 7c62b70
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pretalx_downstream/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@ def _create_user(name, event):
return user


def _get_changes(talk, optout, sub):
def _get_changes(talk, optout, sub, fallback_locale=None):
changes = dict()
change_tracking_data = {
"title": talk.find("title").text,
"do_not_record": optout,
"content_locale": talk.find("language").text if talk.find("language") else "en",
"content_locale": (
talk.find("language").text
if talk.find("language")
else fallback_locale or "en"
),
}
for key in ("description", "abstract"):
try:
Expand Down Expand Up @@ -237,7 +241,7 @@ def _create_talk(*, talk, room, event):
if track:
sub.track = track

changes = _get_changes(talk, optout, sub)
changes = _get_changes(talk, optout, sub, fallback_locale=event.locale)
sub.save()

persons = talk.find("persons")
Expand Down

0 comments on commit 7c62b70

Please sign in to comment.