This commit is contained in:
Ross
2021-04-26 11:04:42 +01:00
parent a94264eff0
commit f129fd4549
2 changed files with 10 additions and 4 deletions
+6
View File
@@ -270,6 +270,12 @@ class RapidCreateBase(LoginRequiredMixin, CreateView):
model = Rapid
form_class = RapidForm
# Sending user object to the form, to verify which fields to display/remove (depending on group)
def get_form_kwargs(self):
kwargs = super(RapidCreateBase, self).get_form_kwargs()
kwargs.update({'user': self.request.user})
return kwargs
def get_context_data(self, **kwargs):
context = super(RapidCreateBase, self).get_context_data(**kwargs)
if self.request.POST: