aboutsummaryrefslogtreecommitdiffstats
path: root/ctrack/register/forms.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ctrack/register/forms.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/ctrack/register/forms.py b/ctrack/register/forms.py
index b09804e..1d46c36 100644
--- a/ctrack/register/forms.py
+++ b/ctrack/register/forms.py
@@ -11,6 +11,7 @@ from ctrack.register.models import (
EngagementType,
CAFSingleDateEvent,
SingleDateTimeEvent,
+ CAFTwinDateEvent,
)
@@ -58,6 +59,29 @@ class CAFSingleDateEventForm(forms.ModelForm):
return form
+class CAFTwinDateEventForm(forms.ModelForm):
+ class Meta:
+ model = CAFTwinDateEvent
+ fields = [
+ "type_descriptor",
+ "related_caf",
+ "short_description",
+ "start_date",
+ "end_date",
+ "comments",
+ ]
+
+ def __init__(self, *args, **kwargs):
+ self.user = kwargs.pop("user")
+ super().__init__(*args, **kwargs)
+
+ def save(self, **kwargs):
+ form = super().save(commit=False)
+ form.user = self.user
+ form.save()
+ return form
+
+
class EngagementEventCreateForm(forms.ModelForm):
def __init__(self, user, caf=None, org_slug=None, *args, **kwargs):
super().__init__(*args, **kwargs)