[scrobbles] Allow Bearer or Token
All checks were successful
build & deploy / test (push) Successful in 1m40s
build & deploy / deploy (push) Successful in 23s

This commit is contained in:
2026-03-31 14:43:22 -04:00
parent 3058bfdd22
commit 59998ac849
2 changed files with 3 additions and 7 deletions

View File

@ -23,16 +23,12 @@ def build_scrobbles(client, request_json, num=7, spacing=2, auth_token=None):
headers = {"Authorization": f"Token {auth_token}"}
user = Token.objects.get(key=auth_token).user
client.post(
url, request_json, content_type="application/json", headers=headers
)
client.post(url, request_json, content_type="application/json", headers=headers)
track = Scrobble.objects.last().track
est = pytz.timezone("US/Eastern")
for i in range(num):
naive_time = timezone.now().replace(tzinfo=None) - timedelta(
days=i * spacing
)
naive_time = timezone.now().replace(tzinfo=None) - timedelta(days=i * spacing)
aware_time = est.localize(naive_time)
Scrobble.objects.create(
user=user,

View File

@ -93,7 +93,7 @@ logger = logging.getLogger(__name__)
class WebhookView(APIView):
permission_classes = [IsAuthenticated]
authentication_classes = [BearerTokenAuthentication]
authentication_classes = [TokenAuthentication, BearerTokenAuthentication]
@property
def logger(self):