Opened 9 years ago

Closed 8 years ago

Last modified 3 years ago

#2228 closed enhancement (wontfix)

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

Reported by: Tyson Tate <tyson@…> Owned by: adrian
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@…> 9 years ago.
Adds e-mail and URL capability
comment_test.zip (10.8 KB) - added by Tyson Tate <tyson@…> 9 years ago.
Sample use of free comments with e-mail and URL.
better_comments2.diff (3.9 KB) - added by Tyson Tate <tyson@…> 9 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@…> 9 years ago.
Adds error output for field validation
better_comments3.diff (4.2 KB) - added by bjornkri 7 years ago.
Simply an update of the diff file for more recent releases.

Download all attachments as: .zip

Change History (21)

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

Adds e-mail and URL capability

comment:1 Changed 9 years ago by ubernostrum

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 9 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 9 years ago by Tyson Tate <tyson@…>

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

comment:3 Changed 9 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 9 years ago by Tyson Tate <tyson@…>

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

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

Adds error output for field validation

comment:4 Changed 9 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 9 years ago by hi-world cup

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

comment:6 Changed 9 years ago by adrian

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

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

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

Stupid spam. *grumble grumble*

comment:8 Changed 8 years ago by adrian

  • Component changed from Contrib apps to django.contrib.comments

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

  • Triage Stage changed from Unreviewed to Accepted

comment:10 Changed 8 years ago by mtredinnick

  • Resolution set to wontfix
  • Status changed from new to closed

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 8 years ago by anonymous

xvcxvxc

comment:12 Changed 8 years ago by anonymous

  • Component changed from django.contrib.comments to Database wrapper
  • Keywords fitness equipment health and fitness added
  • Triage Stage changed from Accepted to Design decision needed
  • Version set to new-admin

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

  • Keywords fitness equipment health and fitness removed
  • Version new-admin deleted

spam cleanup

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

  • Component changed from Database wrapper to django.contrib.comments

comment:16 Changed 7 years ago by russellm

Reverted ticket spam

Changed 7 years ago by bjornkri

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

comment:17 Changed 3 years ago by jacob

  • milestone 1.0 beta deleted

Milestone 1.0 beta deleted

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