mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
Properly display form errors in counter
This commit is contained in:
@ -261,6 +261,11 @@ class CounterClick(CounterTabsMixin, CanViewMixin, SingleObjectMixin, FormView):
|
||||
)
|
||||
kwargs["customer"] = self.customer
|
||||
|
||||
# To get all forms errors to the javascript, we create a list of error list
|
||||
kwargs["form_errors"] = []
|
||||
for field_errors in kwargs["form"].errors:
|
||||
kwargs["form_errors"].append(list(field_errors.values()))
|
||||
|
||||
if self.object.type == "BAR":
|
||||
kwargs["student_card_fragment"] = StudentCardFormView.get_template_data(
|
||||
self.customer
|
||||
|
Reference in New Issue
Block a user