remove redundant list conversion

unique_users is only used to iterate over and set is an iterable
so i do not need to convert it to list
This commit is contained in:
Lili (Tlapka) 2023-01-03 13:32:07 +01:00
parent e65ffae8ce
commit 8e461c5076
1 changed files with 1 additions and 1 deletions

View File

@ -14,7 +14,7 @@ def give_points_to_chat(db):
url = current_app.config['OWNCAST_INSTANCE_URL'] + '/api/integrations/clients'
headers = {"Authorization": "Bearer " + current_app.config['OWNCAST_ACCESS_TOKEN']}
r = requests.get(url, headers=headers)
unique_users = list(set(map(lambda user_object: user_object["user"]["id"], r.json())))
unique_users = set(map(lambda user_object: user_object["user"]["id"], r.json()))
for user_id in unique_users:
give_points_to_user(db,
user_id,