From 0e99da716007a2ee949f5473d2eb6279c934c088 Mon Sep 17 00:00:00 2001 From: David Hu Date: Fri, 5 Apr 2013 13:07:32 -0700 Subject: [PATCH] Fix unexpected NO_EMAILS error when users remove their email. --- r2/r2/controllers/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 0c01b5d1d..bad668750 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -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()