Private
Public Access
1
0

reset emailbounced when user changes email

This commit is contained in:
Sander Roosendaal
2018-03-17 19:39:03 +01:00
parent d64cc9485d
commit d3e3aa1343
2 changed files with 13 additions and 0 deletions

View File

@@ -11231,11 +11231,16 @@ def rower_edit_view(request,rowerid=0,message=""):
getemailnotifications = cd['getemailnotifications'] getemailnotifications = cd['getemailnotifications']
defaulttimezone=cd['defaulttimezone'] defaulttimezone=cd['defaulttimezone']
u = r.user u = r.user
if u.email != email and len(email):
resetbounce = True
else:
resetbounce = False
if len(first_name): if len(first_name):
u.first_name = first_name u.first_name = first_name
u.last_name = last_name u.last_name = last_name
if len(email): ## and check_email_freeforuse(u,email): if len(email): ## and check_email_freeforuse(u,email):
u.email = email u.email = email
resetbounce = True
u.save() u.save()
@@ -11246,6 +11251,9 @@ def rower_edit_view(request,rowerid=0,message=""):
r.showfavoritechartnotes = showfavoritechartnotes r.showfavoritechartnotes = showfavoritechartnotes
r.sex = sex r.sex = sex
r.birthdate = birthdate r.birthdate = birthdate
if resetbounce and r.emailbounced:
print "aap"
r.emailbounced = False
r.save() r.save()
form = RowerForm(instance=r) form = RowerForm(instance=r)
powerform = RowerPowerForm(instance=r) powerform = RowerPowerForm(instance=r)

View File

@@ -247,6 +247,11 @@
{{ user.rower.protrialexpires|date_dif|ddays }} days left in Pro trial {{ user.rower.protrialexpires|date_dif|ddays }} days left in Pro trial
</p> </p>
{% endif %} {% endif %}
{% if user.rower.emailbounced %}
<p class="message">
Your email bounced. Please update your email address in the <a href="/rowers/me/edit/">user settings</a>
</p>
{% endif %}
{% if messages %} {% if messages %}
{% for message in messages %} {% for message in messages %}
{% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %} {% if message.level == DEFAULT_MESSAGE_LEVELS.ERROR %}