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:
parent
e65ffae8ce
commit
8e461c5076
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue