Skip to content

Commit

Permalink
Fix an error when an anonymous user fills the form
Browse files Browse the repository at this point in the history
SaveDBAction.execute method uses request.user for
form_user but request.user is not an instance of User for AnonymousUsers
therefore we need to check for whether the user is logged in or not
  • Loading branch information
arunk committed Aug 25, 2024
1 parent 20d0f69 commit a5f3eab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion djangocms_form_builder/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def execute(self, form, request):
keys = {}
defaults = {
"form_name": get_option(form, "form_name"),
"form_user": request.user,
"form_user": request.user if get_option(form, "login_required", False) else None
}
defaults.update(
{
Expand Down

0 comments on commit a5f3eab

Please sign in to comment.