Code

Opened 3 years ago

Closed 3 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.

Attachments (0)

Change History (2)

comment:1 Changed 3 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 3 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.