We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5d21a0 commit 2029f1dCopy full SHA for 2029f1d
kitsune/questions/admin.py
@@ -47,12 +47,15 @@ class QuestionLocaleInlineFormSet(BaseInlineFormSet):
47
def clean(self):
48
super().clean()
49
50
+ if not self.instance.pk:
51
+ return
52
+
53
# Calculate how many locales actually remain after deletions.
54
num_locales = self.total_form_count() - len(self.deleted_forms)
55
56
active_configs = self.instance.support_configs.filter(is_active=True)
57
- if (num_locales == 0) and self.instance.pk and active_configs.exists():
58
+ if (num_locales == 0) and active_configs.exists():
59
product_names = ", ".join(active_configs.values_list("product__title", flat=True))
60
raise forms.ValidationError(
61
"Cannot remove all enabled locales. This configuration is used "
0 commit comments