mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-29 05:51:51 -05:00
Refactor code
This commit is contained in:
@@ -5,7 +5,7 @@ from app.dao.inbound_numbers_dao import (
|
||||
dao_get_inbound_number_for_service,
|
||||
dao_get_available_inbound_numbers,
|
||||
dao_set_inbound_number_to_service,
|
||||
dao_set_inbound_number_active_flag_for_service
|
||||
dao_set_inbound_number_active_flag
|
||||
)
|
||||
from app.errors import register_errors
|
||||
from app.models import InboundNumber
|
||||
@@ -35,11 +35,11 @@ def post_allocate_or_reactivate_inbound_number(service_id):
|
||||
else:
|
||||
return '', 409
|
||||
else:
|
||||
dao_set_inbound_number_active_flag_for_service(service_id, active=True)
|
||||
dao_set_inbound_number_active_flag(service_id, active=True)
|
||||
return '', 204
|
||||
|
||||
|
||||
@inbound_number_blueprint.route('/<uuid:service_id>/off', methods=['POST'])
|
||||
def post_deactivate_inbound_number(service_id):
|
||||
dao_set_inbound_number_active_flag_for_service(service_id, active=False)
|
||||
dao_set_inbound_number_active_flag(service_id, active=False)
|
||||
return '', 204
|
||||
|
||||
@@ -1051,20 +1051,11 @@ def admin_request(client):
|
||||
data=json.dumps(_data),
|
||||
headers=[('Content-Type', 'application/json'), create_authorization_header()]
|
||||
)
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
assert resp.status_code == _expected_status, json_resp
|
||||
=======
|
||||
if resp.get_data:
|
||||
=======
|
||||
if resp.get_data():
|
||||
>>>>>>> Fixed admin_request bug
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
else:
|
||||
json_resp = None
|
||||
assert resp.status_code == _expected_status
|
||||
>>>>>>> Refactor conftest
|
||||
return json_resp
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user