fix error when being rate limited

This commit is contained in:
Corban-Lee Jones 2024-09-27 12:22:59 +01:00
parent 66e41ab53d
commit ce263b23f4

View File

@ -1,7 +1,8 @@
# -*- encoding: utf-8 -*-
import httpx
import json
import httpx
from django.conf import settings
from django.utils import timezone
from asgiref.sync import sync_to_async
@ -36,6 +37,8 @@ class GuildsView(View):
)
guild_data = response.json()
if "retry_after" in guild_data:
return JsonResponse(guild_data, safe=False)
# guilds where the user either administrates or owns
cleaned_guild_data = []