Skip to content
Browse files

Allow users to remove their email address.

  • Loading branch information...
1 parent 9886db8 commit ca01b8c6223257231fb8c337ec5bfe755f3084f2 @bsimpson63 bsimpson63 committed Mar 20, 2012
Showing with 11 additions and 1 deletion.
  1. +11 −1 r2/r2/controllers/api.py
View
12 r2/r2/controllers/api.py
@@ -645,7 +645,17 @@ def POST_update(self, form, jquery, email, password, verify):
_("you should be getting a verification email shortly."))
else:
form.set_html('.status', _('your email has been updated'))
-
+
+ # user is removing their email
+ if (not email and c.user.email and
+ form.has_errors("email", errors.NO_EMAILS)):
+ c.user.email = ''
+ c.user.email_verified = None
+ c.user._commit()
+ Award.take_away("verified_email", c.user)
+ updated = True
+ form.set_html('.status', _('your email has been updated'))
+
# change password
if (password and
not (form.has_errors("newpass", errors.BAD_PASSWORD) or

0 comments on commit ca01b8c

Please sign in to comment.
Something went wrong with that request. Please try again.