Allow special characters &,-,_ for ship name and callsign
This commit is contained in:
parent
7fea4d27b7
commit
2df07093ef
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user