Self hosted FLOSS fitness/workout, nutrition and weight tracker
only validate languages if languages is not None
Joshua Shelley38e0e82bc6f8
diff --git a/wger/nutrition/management/commands/sync-ingredients.py b/wger/nutrition/management/commands/sync-ingredients.pyindex b25447813..08bc6371c 100644--- a/wger/nutrition/management/commands/sync-ingredients.py+++ b/wger/nutrition/management/commands/sync-ingredients.py@@ -65,8 +65,9 @@ class Command(BaseCommand):raise CommandError('Please enter a valid URL')try:self.languages = languages- for language in self.languages.split(','):- validate_language_code(language)+ if self.languages is not None:+ for language in self.languages.split(','):+ validate_language_code(language)except ValidationError as e:raise CommandError('\n'.join([str(arg) for arg in e.args if arg is not None]))