created primary keys are not editable
This commit is contained in:
@@ -312,18 +312,7 @@ class ResolutionAdminForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Resolution
|
||||
|
||||
fields = [
|
||||
"name",
|
||||
"id",
|
||||
"date",
|
||||
"option",
|
||||
"is_visible",
|
||||
"budget",
|
||||
"total",
|
||||
"budget_remaining",
|
||||
"voting",
|
||||
"voting_text",
|
||||
]
|
||||
fields = "__all__"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs) # to get the self.fields set
|
||||
@@ -348,6 +337,12 @@ class ResolutionAdminForm(forms.ModelForm):
|
||||
self.fields["budget_remaining"].label = "Restbudget (EUR)"
|
||||
self.fields["budget_remaining"].required = False
|
||||
|
||||
self.fields["budget"].required = False
|
||||
|
||||
if resolution is not None:
|
||||
self.fields["id"].disabled = True
|
||||
self.fields["id"].required = False
|
||||
|
||||
|
||||
class WirefAdminForm(forms.ModelForm):
|
||||
total = forms.CharField()
|
||||
|
||||
Reference in New Issue
Block a user