Skip to content

Commit

Permalink
Merge pull request #620 from CTPUG/bugfix/handle_no_language_in_admin…
Browse files Browse the repository at this point in the history
…_form

Force default to None if the list of allowed languages is empty
  • Loading branch information
drnlm committed Sep 22, 2021
2 parents 5e2883e + 60b623f commit 9d3d0f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wafer/talks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ class Meta:
Track, verbose_name=_("track"), null=True, blank=True, on_delete=models.SET_NULL)

LANGUAGES = settings.WAFER_TALK_LANGUAGES
DEFAULT_LANGUAGE = LANGUAGES and LANGUAGES[0][0]
# DEFAULT_LANGUAGE should be None if WAFER_TALK_LANGUAGES is empty
DEFAULT_LANGUAGE = LANGUAGES[0][0] if LANGUAGES else None
language = models.CharField(
verbose_name=_("language"),
max_length=5,
Expand Down

0 comments on commit 9d3d0f7

Please sign in to comment.