summaryrefslogtreecommitdiffstats
path: root/engagements/views.py
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-09-09 14:55:38 +0100
committerMatthew Lemon <y@yulqen.org>2024-09-09 14:55:38 +0100
commit09b099e467df64ac8ce44bbe2d1f80cd1c00a126 (patch)
treeb4f4110337cde4d0586c3152d42ce9b5133faf53 /engagements/views.py
parente57e4a03bbe67d3801656ceb5c2f8249dba6456d (diff)
Basic validation on start and end dates for Engagement
- form validation when end date is before the start date
Diffstat (limited to '')
-rw-r--r--engagements/views.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/engagements/views.py b/engagements/views.py
index a76a37d..88f2014 100644
--- a/engagements/views.py
+++ b/engagements/views.py
@@ -155,6 +155,12 @@ def engagement_create(request, slug, reg=None):
ef.external_party = Organisation.objects.get(slug=slug)
ef.save()
return redirect("engagements:plan_for_org", orgslug=slug)
+ else:
+ return render(
+ request,
+ "engagements/engagement_form.html",
+ {"form": form, "title": f"Create Engagement for {slug}", "errors": form.errors},
+ )
else:
if reg:
form = EngagementCreateForm(