diff --git a/website/orders/api/v1/filters.py b/website/orders/api/v1/filters.py
index d7b8c9fa..b17d1b5f 100644
--- a/website/orders/api/v1/filters.py
+++ b/website/orders/api/v1/filters.py
@@ -2,7 +2,7 @@
from django_filters.rest_framework import FilterSet, ModelChoiceFilter
from django.db import models
-from orders.models import Shift, Order, Product, OrderVenue
+from orders.models import Shift, Order, Product
from venues.models import Venue
diff --git a/website/status_screen/templates/status_screen/venue_status_screen.html b/website/status_screen/templates/status_screen/venue_status_screen.html
index 6ef67768..1b8c235a 100644
--- a/website/status_screen/templates/status_screen/venue_status_screen.html
+++ b/website/status_screen/templates/status_screen/venue_status_screen.html
@@ -137,7 +137,7 @@
No player for this venue
}
}
- get_oauth_token_with_client_credentials(this.client_id, this.client_secret)
+ get_oauth_token_with_client_credentials("{% url "oauth2_provider:token" %}", this.client_id, this.client_secret)
.then(data => {
this.oauth_token = data;
resolve(this.oauth_token.access_token);
diff --git a/website/tosti/static/tosti/js/base.js b/website/tosti/static/tosti/js/base.js
index 5c605da6..e5e012c5 100644
--- a/website/tosti/static/tosti/js/base.js
+++ b/website/tosti/static/tosti/js/base.js
@@ -162,12 +162,12 @@ function formatPrice(priceToFormat) {
}).format(priceToFormat).trim();
}
-function get_oauth_token_with_client_credentials(client_id, client_secret) {
+function get_oauth_token_with_client_credentials(token_endpoint, client_id, client_secret) {
let credentials = client_id + ":" + client_secret;
let credentials_utf8 = strToUTF8Arr(credentials);
let credentials_base64 = base64EncArr(credentials_utf8);
return fetch(
- "/oauth/token/",
+ token_endpoint,
{
method: 'POST',
headers: {