# TODO: There is no error handling in place
send_email(
mg_globals.app_config['email_sender_address'],
- [user['email']],
+ [user.email],
# TODO
# Due to the distributed nature of GNU MediaGoblin, we should
# find a way to send some additional information about the
# TODO: There is no error handling in place
send_email(
mg_globals.app_config['email_sender_address'],
- [user['email']],
+ [user.email],
'GNU MediaGoblin - Change forgotten password!',
rendered_email)
# Create the user
user = request.db.User()
user.username = username
- user['email'] = email
+ user.email = email
user['pw_hash'] = auth_lib.bcrypt_gen_password_hash(
request.POST['password'])
user.save(validate=True)
# Create the user
entry = db.User()
entry.username = unicode(args.username.lower())
- entry['email'] = unicode(args.email)
+ entry.email = unicode(args.email)
entry['pw_hash'] = auth_lib.bcrypt_gen_password_hash(args.password)
entry['status'] = u'active'
entry['email_verified'] = True
new_user = mg_globals.database.User()
new_user.username = u'lolcat'
- new_user['email'] = u'lol@cats.example.org'
+ new_user.email = u'lol@cats.example.org'
new_user['pw_hash'] = u'pretend_this_is_a_hash'
new_user.save()
assert mg_globals.database.User.find().count() == 1