In some places the variable 'profile_id' holds the value 'null' where the code expects an int or None (#1395)

This commit is contained in:
Michiel van Baak Jansen 2021-05-02 14:02:16 +02:00 committed by GitHub
parent 4ee33e6e4e
commit bd16279601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -293,7 +293,7 @@ def get_profiles_list(profile_id=None):
if not len(profile_id_list):
update_profile_id_list()
if profile_id:
if profile_id and profile_id != 'null':
for profile in profile_id_list:
if profile['profileId'] == profile_id:
return profile
@ -307,7 +307,7 @@ def get_desired_languages(profile_id):
if not len(profile_id_list):
update_profile_id_list()
if profile_id:
if profile_id and profile_id != 'null':
for profile in profile_id_list:
profileId, name, cutoff, items = profile.values()
if profileId == int(profile_id):
@ -323,7 +323,7 @@ def get_profile_id_name(profile_id):
if not len(profile_id_list):
update_profile_id_list()
if profile_id:
if profile_id and profile_id != 'null':
for profile in profile_id_list:
profileId, name, cutoff, items = profile.values()
if profileId == int(profile_id):
@ -339,7 +339,7 @@ def get_profile_cutoff(profile_id):
if not len(profile_id_list):
update_profile_id_list()
if profile_id:
if profile_id and profile_id != 'null':
cutoff_language = []
for profile in profile_id_list:
profileId, name, cutoff, items = profile.values()