aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/user.rb5
-rw-r--r--todo.txt1
2 files changed, 4 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index a333e5721..b03cf18cc 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: user.rb,v 1.2 2007-08-04 11:10:26 francis Exp $
+# $Id: user.rb,v 1.3 2007-09-03 09:09:02 francis Exp $
require 'digest/sha1'
@@ -21,6 +21,9 @@ class User < ActiveRecord::Base
def validate
errors.add_to_base("Missing password") if hashed_password.blank?
+ unless MySociety::Validate.is_valid_email(email)
+ errors.add(:email, "doesn't look like a valid address")
+ end
end
# Return user given login email and password
diff --git a/todo.txt b/todo.txt
index 0ea666164..6ed0a6504 100644
--- a/todo.txt
+++ b/todo.txt
@@ -5,7 +5,6 @@ Fix up how we do HTML 4.0
Public body
-----------
-Validate email address
Put links from front admin page
Log user who made change to public body
Display history of public body in admin