Opened 10 years ago

Closed 10 years ago

Last modified 5 years ago

#2228 closed enhancement (wontfix)

[patch] Add e-mail and URL to free comments

Reported by: Tyson Tate <tyson@…> Owned by: Adrian Holovaty
Component: contrib.comments Version:
Severity: normal Keywords:
Cc: tyson@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Replaces #2184 due to comment spam.

This patch adds the ability for comments to accept a person's e-mail address and/or URL, optionally. This is a feature found in most comment systems and would be very useful in Django.

The current patch doesn't validate e-mail addresses or URLs, because I'm not too sure where I should do that.

Attachments (5)

better_comments.diff (3.9 KB) - added by Tyson Tate <tyson@…> 10 years ago.
Adds e-mail and URL capability
comment_test.zip (10.8 KB) - added by Tyson Tate <tyson@…> 10 years ago.
Sample use of free comments with e-mail and URL.
better_comments2.diff (3.9 KB) - added by Tyson Tate <tyson@…> 10 years ago.
Changed from TextField to proper fields and, by consequence, adds proper error checking
comment_test2.zip (14.4 KB) - added by Tyson Tate <tyson@…> 10 years ago.
Adds error output for field validation
better_comments3.diff (4.2 KB) - added by Bjorn Kristinsson 8 years ago.
Simply an update of the diff file for more recent releases.

Download all attachments as: .zip

Change History (21)

Changed 10 years ago by Tyson Tate <tyson@…>

Attachment: better_comments.diff added

Adds e-mail and URL capability

comment:1 Changed 10 years ago by James Bennett

EmailField and URLField both have their own validation routines baked in; EmailField makes sure you've entered something that looks like an email address (though it won't email to validate for you; that'd be something that could be developed on a per-case basis), and URLField checks the format of the URL and, by default, hits it to make sure it exists.

comment:2 Changed 10 years ago by Tyson Tate <tyson@…>

Cc: tyson@… added

I set up a small test app, and was able to enter "x" for all fields (name, e-mail, url, comment), and both e-mail and url were accepted as "x" and displayed as "x". In the database, they were stored as "x".

Is there someplace that I should set-up proper validation? I think it might be handy that, if a developer adds the e-mail and url fields, the fields get validated like the name field is checked for emptiness.

I'll attach my sample project.

Changed 10 years ago by Tyson Tate <tyson@…>

Attachment: comment_test.zip added

Sample use of free comments with e-mail and URL.

comment:3 Changed 10 years ago by greg[at]abbas.org

Hi Tyson, +1 from me (FWIW :-) on this, you're absolutely right IMHO that free comments ought to support email address & URL.

Regarding the validation issue, you probably want to change django/contrib/comments/views/comments.py so that it instantiates a forms.URLField and a forms.EmailField, instead of two plain TextFields.

-greg a.

Changed 10 years ago by Tyson Tate <tyson@…>

Attachment: better_comments2.diff added

Changed from TextField to proper fields and, by consequence, adds proper error checking

Changed 10 years ago by Tyson Tate <tyson@…>

Attachment: comment_test2.zip added

Adds error output for field validation

comment:4 Changed 10 years ago by Tyson Tate <tyson@…>

A hah! I knew I was missing something simple. I've uploaded a better patch and an updated comment test project. I've tried messing it up in a number of ways, but it looks pretty fool-proof now.

Thanks, Greg!

comment:5 Changed 10 years ago by hi-world cup

Cc: hi-world cup added; tyson@… removed
Keywords: rthml tab space editor js added
Summary: [patch] Add e-mail and URL to free commentshi-world cup

comment:6 Changed 10 years ago by Adrian Holovaty

Cc: hi-world cup removed
Summary: hi-world cup[patch] Add e-mail and URL to free comments

comment:7 Changed 10 years ago by Tyson Tate <tyson@…>

Cc: tyson@… added
Keywords: rthml tab space editor js removed

Stupid spam. *grumble grumble*

comment:8 Changed 10 years ago by Adrian Holovaty

Component: Contrib appsdjango.contrib.comments

comment:9 Changed 10 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedAccepted

comment:10 Changed 10 years ago by Malcolm Tredinnick

Resolution: wontfix
Status: newclosed

Jacob is rewriting the comments app for 1.0, so it isn't worth applying this and taking the compatibility hit for just one release.

comment:11 Changed 10 years ago by anonymous

xvcxvxc

comment:12 Changed 9 years ago by anonymous

Component: django.contrib.commentsDatabase wrapper
Keywords: fitness equipment health and fitness added
Triage Stage: AcceptedDesign decision needed
Version: new-admin

comment:13 Changed 9 years ago by Simon G. <dev@…>

Keywords: fitness equipment health and fitness removed
Version: new-admin

spam cleanup

comment:14 Changed 9 years ago by Simon G. <dev@…>

Component: Database wrapperdjango.contrib.comments

comment:16 Changed 9 years ago by Russell Keith-Magee

Reverted ticket spam

Changed 8 years ago by Bjorn Kristinsson

Attachment: better_comments3.diff added

Simply an update of the diff file for more recent releases.

comment:17 Changed 5 years ago by Jacob

milestone: 1.0 beta

Milestone 1.0 beta deleted

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