Compare commits

...

2 Commits

2 changed files with 30 additions and 4 deletions

View File

@ -1,11 +1,37 @@
use bremen_calling_test;
-- This script clears all data from the database tables related to the port management system.
DELETE FROM notification WHERE id > 0;
DELETE FROM history WHERE id > 0;
DELETE FROM notification WHERE id > 0;
DELETE FROM shipcall_participant_map WHERE id > 0;
DELETE FROM participant_port_map WHERE id > 0;
DELETE FROM shipcall_tug_map WHERE id > 0;
DELETE FROM times WHERE id > 0;
DELETE FROM shipcall WHERE id > 0;
DELETE FROM shipcall WHERE id > 0;
DELETE FROM user_role_map WHERE id > 0;
DELETE FROM role_securable_map WHERE id > 0;
DELETE FROM user_role_map WHERE id > 0;
DELETE FROM securable WHERE id > 0;
DELETE FROM role WHERE id > 0;
DELETE FROM user WHERE id > 0;
delete FROM ship WHERE id > 0;
DELETE FROM berth WHERE id > 0;
DELETE FROM participant WHERE id > 0;
DELETE FROM port WHERE id > 0;

View File

@ -14,13 +14,13 @@ def check_if_string_has_special_characters(text:typing.Optional[str]):
"""
if text is None:
return False
return bool(set(text).difference(ascii_letters + digits + ' '))
return bool(set(text).difference(ascii_letters + digits + ' ' + '&' + '_' + '-'))
def check_if_int_is_valid_flag(value, enum_object):
if value is None: # when no value is provided, the value is considered valid.
return False
# e.g., when an IntFlag has the values 1,2,4; the maximum valid value is 7
max_int = sum([int(val) for val in list(enum_object._value2member_map_.values())])
return 0 < value <= max_int