mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 10:03:38 -04:00
Fix for empty response 204.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from flask import (jsonify, request)
|
from flask import (jsonify, request, abort)
|
||||||
from sqlalchemy.exc import DataError
|
from sqlalchemy.exc import DataError
|
||||||
from sqlalchemy.orm.exc import NoResultFound
|
from sqlalchemy.orm.exc import NoResultFound
|
||||||
from app.dao.services_dao import get_model_services
|
from app.dao.services_dao import get_model_services
|
||||||
@@ -69,7 +69,7 @@ def verify_user_password(user_id):
|
|||||||
result="error",
|
result="error",
|
||||||
message={'password': ['Required field missing data']}), 400
|
message={'password': ['Required field missing data']}), 400
|
||||||
if user.check_password(txt_pwd):
|
if user.check_password(txt_pwd):
|
||||||
return jsonify(), 204
|
return jsonify(''), 204
|
||||||
else:
|
else:
|
||||||
return jsonify(result='error', message={'password': ['Incorrect password']}), 400
|
return jsonify(result='error', message={'password': ['Incorrect password']}), 400
|
||||||
|
|
||||||
@@ -102,7 +102,7 @@ def verify_user_code(user_id):
|
|||||||
if datetime.now() > code.expiry_datetime or code.code_used:
|
if datetime.now() > code.expiry_datetime or code.code_used:
|
||||||
return jsonify(result="error", message="Code has expired"), 400
|
return jsonify(result="error", message="Code has expired"), 400
|
||||||
use_user_code(code.id)
|
use_user_code(code.id)
|
||||||
return jsonify(), 204
|
return jsonify(''), 204
|
||||||
|
|
||||||
|
|
||||||
@user.route('/<int:user_id>/code/', methods=['POST'])
|
@user.route('/<int:user_id>/code/', methods=['POST'])
|
||||||
@@ -133,7 +133,7 @@ def send_user_code(user_id):
|
|||||||
'Verification code')
|
'Verification code')
|
||||||
else:
|
else:
|
||||||
abort(500)
|
abort(500)
|
||||||
return jsonify(), 204
|
return jsonify(''), 204
|
||||||
|
|
||||||
|
|
||||||
@user.route('/<int:user_id>', methods=['GET'])
|
@user.route('/<int:user_id>', methods=['GET'])
|
||||||
|
|||||||
Reference in New Issue
Block a user