Opened 4 years ago

Closed 4 years ago

#15841 closed Bug (needsinfo)

User model conflicts with CommentDetailsForm

Reported by: admin@… Owned by: nobody
Component: contrib.comments Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:

Description

User.email defined as "blank = True", but CommentDetailsForm.email is required. This results violation of form validation when authorized user without email posts comment.

Change History (2)

comment:1 Changed 4 years ago by admin@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Summary changed from User conflict with CommentDetailsForm to User model conflicts with CommentDetailsForm

comment:2 Changed 4 years ago by aaugustin

  • Easy pickings unset
  • Resolution set to needsinfo
  • Status changed from new to closed

By design, CommentDetailsForm requires an email address. As a direct consequence, so does CommentForm. Many people rely on this behavior and it should not be changed lightly.

If this is an issue for you, you can subclass CommentDetailsForm and set blank=True for the email field.

As far as I can tell, when a user is logged in and posts a comment without filling in his details, django.contrib.comments.views.comments.post_comment will add them based on the user's profile. However, this is not documented. Since a user without an email in his profile can always give it in the comments form, I don't think there's a bug.

Please provide more information on how to reproduce your issue if this answer is not satisfying.

Note: See TracTickets for help on using tickets.
Back to Top