Skip to content

Commit a1393d8

Browse files
committed
logging
1 parent 2760597 commit a1393d8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

peachjam/admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,10 @@ class NewForm(self.new_document_form_mixin, form):
844844
return super().get_form(request, obj, **kwargs)
845845

846846
def render_change_form(self, request, context, *args, **kwargs):
847+
# The document admin form is complex. Sometimes we get validation errors that are about hidden fields.
848+
# So here we check for validation errors in the form and any inlines and add a non-field error to the main
849+
# form with a summary of the fields that have errors. We also log the validation errors with some context to
850+
# help with debugging.
847851
if request.method == "POST" and not getattr(
848852
request, "_document_admin_validation_reported", False
849853
):

0 commit comments

Comments
 (0)