From 9127cdeac8fc3c64ad857a72dbf4a9f11e22064a Mon Sep 17 00:00:00 2001 From: Max Metz Date: Mon, 9 Sep 2024 17:06:03 +0200 Subject: [PATCH] BSMD users are now allowed to POST times entry, if they are assigned to the ShipcallParticipantMap or the special BSMD-flag-clause takes place --- src/server/BreCal/validators/input_validation_times.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/server/BreCal/validators/input_validation_times.py b/src/server/BreCal/validators/input_validation_times.py index 7e402fa..e0726fc 100644 --- a/src/server/BreCal/validators/input_validation_times.py +++ b/src/server/BreCal/validators/input_validation_times.py @@ -85,13 +85,10 @@ class InputValidationTimes(): # 2.) datasets may only be created, if the respective participant type did not already create one. InputValidationTimes.check_if_entry_already_exists_for_participant_type(user_data, loadedModel, content) - # 3.) only users who are *not* of type BSMD may post times datasets. - InputValidationTimes.check_user_is_not_bsmd_type(user_data) - - # 4.) Reference checking + # 3.) Reference checking InputValidationTimes.check_dataset_references(content) - # 5.) Value checking + # 4.) Value checking InputValidationTimes.check_dataset_values(user_data, loadedModel, content) return @@ -143,6 +140,7 @@ class InputValidationTimes(): @staticmethod def check_user_is_not_bsmd_type(user_data:dict): """a new dataset may only be created by a user who is *not* belonging to participant group BSMD""" + # this method is deprecated for /times POST requests. As the function may be used elsewhere, it will, for now, not be removed is_bsmd = check_if_user_is_bsmd_type(user_data) if is_bsmd: raise ValidationError({"participant_type":f"current user belongs to BSMD. Cannot post 'times' datasets. Found user data: {user_data}"})