summaryrefslogtreecommitdiffstats
path: root/accounts/views/default
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2016-01-30 04:18:31 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2016-02-02 04:23:19 +0100
commitc6caa836b4fc897b6327fb573cbbcd67764d1cbd (patch)
tree02c161382d31f1bf5f2cea81d0e4399dbc04dccc /accounts/views/default
parentb83ad9d369c21662b0e26dad1e704d3b768b631a (diff)
downloadweb-c6caa836b4fc897b6327fb573cbbcd67764d1cbd.tar.gz
web-c6caa836b4fc897b6327fb573cbbcd67764d1cbd.tar.bz2
web-c6caa836b4fc897b6327fb573cbbcd67764d1cbd.zip
Account: Support direct setting of attributes
Direct access to additional attributes was possible before, but setting the same value, created a new local property: >>> acc = Account(...) >>> acc.mail == acc.attributes['mail'] True >>> acc.mail = "foobar" >>> acc.mail == acc.attributes['mail'] False Not also assignments are possible and all assignments to unknown properties will create new attributes.
Diffstat (limited to 'accounts/views/default')
-rw-r--r--accounts/views/default/__init__.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/accounts/views/default/__init__.py b/accounts/views/default/__init__.py
index edcac21..0a7e65d 100644
--- a/accounts/views/default/__init__.py
+++ b/accounts/views/default/__init__.py
@@ -131,7 +131,7 @@ def lost_password_complete(token):
@templated('index.html')
@login_required
def index():
- form = SettingsForm(request.form, mail=current_user.attributes['mail'])
+ form = SettingsForm(request.form, mail=current_user.mail)
if form.validate_on_submit():
changed = False
@@ -143,7 +143,7 @@ def index():
changed = True
elif request.form.get('submit_main'):
- if form.mail.data and form.mail.data != current_user.attributes['mail']:
+ if form.mail.data and form.mail.data != current_user.mail:
confirm_token = Confirmation('change_mail').dumps((current_user.uid, form.mail.data))
confirm_link = url_for('.change_mail', token=confirm_token, _external=True)