Skip to content

Commit

Permalink
allowed group blank by default in admin form
Browse files Browse the repository at this point in the history
  • Loading branch information
rebkwok committed Dec 28, 2023
1 parent f0aaa26 commit 7c21954
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions studioadmin/forms/event_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ def __init__(self, *args, **kwargs):
queryset=ev_type_qset,
)

self.fields['allowed_group'].widget.attrs = {'class': "form-control"}

ph_type = "event" if ev_type == 'EV' else 'class' if ev_type == "CL" else 'room hire' if ev_type == "RH" else "online tutorial"
ex_name = "Workshop" if ev_type == 'EV' else "Pole Level 1" if ev_type == "CL" else "Private Practice" if ev_type == "RH" else "Spin Combo"
self.fields['name'] = forms.CharField(
Expand Down Expand Up @@ -162,7 +160,6 @@ def __init__(self, *args, **kwargs):
)
else:
self.fields['paypal_email'].initial = settings.DEFAULT_PAYPAL_EMAIL
self.fields['allowed_group'].initial = AllowedGroup.default_group().id

def clean_new_category(self):
new_category = self.cleaned_data.get("new_category")
Expand Down Expand Up @@ -392,6 +389,9 @@ class Meta:
),
'paypal_email': forms.EmailInput(
attrs={'class': "form-control"}
),
'allowed_group': forms.Select(
attrs={'class': "form-control"}
),
}
help_texts = {
Expand Down Expand Up @@ -427,6 +427,9 @@ class Meta:
'Check this carefully! If you enter an incorrect email, '
'payments will fail or could be paid to the wrong account!'
),
'allowed_group': _(
"Group allowed to book this event (leave blank to default to same group as the event type)"
)
}


Expand Down

0 comments on commit 7c21954

Please sign in to comment.