aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'ctrack/register/forms.py')
-rw-r--r--ctrack/register/forms.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ctrack/register/forms.py b/ctrack/register/forms.py
index 1549f75..b061ec3 100644
--- a/ctrack/register/forms.py
+++ b/ctrack/register/forms.py
@@ -35,11 +35,14 @@ class CreateSimpleDateTimeEventForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
self.user = kwargs.pop("user")
self.org_slug = kwargs.pop("org_slug")
+ self.event_type = kwargs.pop("event_type")
super().__init__(*args, **kwargs)
if self.org_slug:
org = Organisation.objects.get(slug=self.org_slug)
self.fields["participants"].queryset = org.get_people()
self.fields["participants"].help_text = f"Click to select participants from {org}."
+ if self.event_type:
+ self.fields["type_descriptor"].initial = self.event_type
else:
self.fields["participants"].widget = forms.HiddenInput()