|
@@ -62,10 +62,10 @@ async def add_gif(action, file_id):
|
|
|
async def get_random_gif(action):
|
|
|
return await action.gifs.all().annotate(order=Random()).order_by('order').first()
|
|
|
|
|
|
-async def assign_color(username):
|
|
|
- user_color = await UserColor.filter(username=username).first()
|
|
|
+async def assign_color(user_id):
|
|
|
+ user_color = await UserColor.filter(user_id=user_id).first()
|
|
|
if not user_color:
|
|
|
- user_color = UserColor(username=username, color=randint(0, 7))
|
|
|
+ user_color = UserColor(user_id=user_id, color=randint(0, 7))
|
|
|
await user_color.save()
|
|
|
|
|
|
return user_color.color
|