In order to mitigate against the brute force attacks against Gitlab accounts, we are moving to all edu-ID Logins. We would like to remind you to link your account with your edu-id. Login will be possible only by edu-ID after November 30, 2021. Here you can find the instructions for linking your account.

If you don't have a SWITCH edu-ID, you can create one with this guide here

kind regards

Commit c693af08 authored by Jonas Waeber's avatar Jonas Waeber
Browse files

Fix path param name.

parent 58089c38
Pipeline #26221 passed with stages
in 1 minute and 42 seconds
......@@ -101,8 +101,8 @@ def create_app(test_config=None):
# api.add_resource(JobReport, '/v1/job/<topic_name>/report')
api.add_resource(WriteJobResultToDrupal, '/v1/drupal/<job_drupal_uuid>/<job_log_drupal_uuid>')
api.add_resource(WriteTypeReportToDrupal, '/v1/drupal/WriteElementReport')
api.add_resource(UpdateInstitution, '/v1/drupal/institution/<institutionId>')
api.add_resource(UpdateRecordSet, '/v1/drupal/recordset/<record_set_id>')
api.add_resource(UpdateInstitution, '/v1/drupal/institution/<institution_drupal_uuid>')
api.add_resource(UpdateRecordSet, '/v1/drupal/recordset/<record_set_drupal_uuid>')
api.add_resource(
DeleteRecord,
'/v1/drupal/delete/record/<session_id>',
......
......@@ -17,7 +17,7 @@ class UpdateRecordSet(Resource):
value_serializer=lambda m: json.dumps(m, ensure_ascii=False)
.encode('utf-8'))
def get(self, record_set_id):
def get(self, record_set_drupal_uuid):
"""
Update the record set with the given drupal UUID in the backend.
---
......@@ -25,7 +25,7 @@ class UpdateRecordSet(Resource):
- Import Record Set
parameters:
- in: path
name: record_set_id
name: record_set_drupal_uuid
required: true
description: The UUID of the updated recordset
example: 0c4c777c-94f8-45ba-945a-bfe6967d40da
......@@ -56,9 +56,9 @@ class UpdateRecordSet(Resource):
# Retrieve Drupal Entities for each language.
# Returns default entity if there is a language missing.
de_drupal_url = f'{base_url}/de{json_api_path}{record_set_id}'
fr_drupal_url = f'{base_url}/fr{json_api_path}{record_set_id}'
it_drupal_url = f'{base_url}/it{json_api_path}{record_set_id}'
de_drupal_url = f'{base_url}/de{json_api_path}{record_set_drupal_uuid}'
fr_drupal_url = f'{base_url}/fr{json_api_path}{record_set_drupal_uuid}'
it_drupal_url = f'{base_url}/it{json_api_path}{record_set_drupal_uuid}'
try:
drupal_record_set_de = \
requests.get(de_drupal_url, headers=headers, auth=auth).json()['data']
......@@ -199,7 +199,7 @@ class UpdateRecordSet(Resource):
'field_teaser_image': drupal_record_set_de['relationships']['field_teaser_image']
}
except LookupError as ex:
msg = 'LookupError for ' + record_set_id + ': ' + str(ex) + '\n' + \
msg = 'LookupError for ' + record_set_drupal_uuid + ': ' + str(ex) + '\n' + \
traceback.format_exc() + '\n' + \
'baseRequest: ' + de_drupal_url + '\n'
current_app.logger.error(msg)
......@@ -209,7 +209,7 @@ class UpdateRecordSet(Resource):
'result_topic_value': result_topic_value
}, 500
except Exception as ex:
msg = 'Exception for ' + record_set_id + ': ' + str(ex) + '\n' + \
msg = 'Exception for ' + record_set_drupal_uuid + ': ' + str(ex) + '\n' + \
traceback.format_exc() + '\n' + \
'baseRequest: ' + de_drupal_url + '\n'
current_app.logger.error(msg)
......@@ -219,7 +219,7 @@ class UpdateRecordSet(Resource):
'result_topic_value': result_topic_value,
}, 500
return self.send_message(result_topic_value, record_set_id)
return self.send_message(result_topic_value, record_set_drupal_uuid)
def send_message(self, result_topic_value, record_set_drupal_id):
headers = [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment