Fix unexpected NO_EMAILS error when users remove their email.

This commit is contained in:
David Hu
2013-04-05 13:07:32 -07:00
committed by bsimpson63
parent d3d82acf97
commit 0e99da7160

View File

@@ -896,7 +896,8 @@ class ApiController(RedditController, OAuth2ResourceController):
# user is removing their email
if (not email and c.user.email and
form.has_errors("email", errors.NO_EMAILS)):
(errors.NO_EMAILS, 'email') in c.errors):
c.errors.remove((errors.NO_EMAILS, 'email'))
c.user.email = ''
c.user.email_verified = None
c.user._commit()