mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-04 05:31:44 -04:00
replace user PUT with POSTs
the update_user fn was used in two places, for things that are handled fine by update_user_attribute. Reduce complexity in the API by killing the PUT, which is more dangerous (might silently overwrite things that shouldn't be, like "last_logged_in_at" etc). Had to change the code not received mobile number form, and the activate user function.
This commit is contained in:
@@ -31,8 +31,7 @@ def check_and_resend_text_code():
|
||||
form = TextNotReceivedForm(mobile_number=user.mobile_number)
|
||||
if form.validate_on_submit():
|
||||
user_api_client.send_verify_code(user.id, 'sms', to=form.mobile_number.data)
|
||||
user.mobile_number = form.mobile_number.data
|
||||
user_api_client.update_user(user)
|
||||
user = user_api_client.update_user_attribute(user.id, mobile_number=form.mobile_number.data)
|
||||
return redirect(url_for('.verify'))
|
||||
|
||||
return render_template('views/text-not-received.html', form=form)
|
||||
|
||||
Reference in New Issue
Block a user