mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Remove endpoints for checking name uniqueness
The code which called these endpoints was removed: - for services in https://github.com/alphagov/notifications-admin/pull/4084/files - for organisations in https://github.com/alphagov/notifications-admin/pull/4128/files Therefore these endpoints are no longer needed.
This commit is contained in:
@@ -174,16 +174,6 @@ def get_organisation_users(organisation_id):
|
||||
return jsonify(data=[x.serialize() for x in org_users])
|
||||
|
||||
|
||||
@organisation_blueprint.route('/unique', methods=["GET"])
|
||||
def is_organisation_name_unique():
|
||||
organisation_id, name = check_request_args(request)
|
||||
|
||||
name_exists = Organisation.query.filter(Organisation.name.ilike(name)).first()
|
||||
|
||||
result = (not name_exists) or str(name_exists.id) == organisation_id
|
||||
return jsonify(result=result), 200
|
||||
|
||||
|
||||
def check_request_args(request):
|
||||
org_id = request.args.get('org_id')
|
||||
name = request.args.get('name', None)
|
||||
|
||||
@@ -940,21 +940,6 @@ def get_organisation_for_service(service_id):
|
||||
return jsonify(organisation.serialize() if organisation else {}), 200
|
||||
|
||||
|
||||
@service_blueprint.route('/unique', methods=["GET"])
|
||||
def is_service_name_unique():
|
||||
service_id, name, email_from = check_request_args(request)
|
||||
|
||||
name_exists = Service.query.filter_by(name=name).first()
|
||||
|
||||
email_from_exists = Service.query.filter(
|
||||
Service.email_from == email_from,
|
||||
Service.id != service_id
|
||||
).first()
|
||||
|
||||
result = not (name_exists or email_from_exists)
|
||||
return jsonify(result=result), 200
|
||||
|
||||
|
||||
@service_blueprint.route('/<uuid:service_id>/data-retention', methods=['GET'])
|
||||
def get_data_retention_for_service(service_id):
|
||||
data_retention_list = fetch_service_data_retention(service_id)
|
||||
|
||||
Reference in New Issue
Block a user