Private
Public Access
1
0

attempt to django 4.2

This commit is contained in:
2024-05-23 09:17:00 +02:00
parent 1fef50fabf
commit 49ab756211
6 changed files with 245 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
from oauth2_provider.views import base
#from oauth2_provider.views import base
from django.conf import settings
from django.conf.urls import url, include, handler404, handler500
from django.conf.urls import include, handler404, handler500
from django.urls import path, re_path
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required, permission_required
@@ -42,14 +42,14 @@ from rowers.forms import ForceCurveMultipleCompareForm
from rowers.models import ForceCurveAnalysis
from rowers.interactiveplots import forcecurve_multi_interactive_chart, instroke_multi_interactive_chart
from oauth2_provider.views import (
AuthorizedTokensListView,
AuthorizedTokenDeleteView,
)
#from oauth2_provider.views import (
# AuthorizedTokensListView,
# AuthorizedTokenDeleteView,
#)
from oauth2_provider.views.base import (
RevokeTokenView
)
#from oauth2_provider.views.base import (
# RevokeTokenView
#)
class PlannedSessionViewSet(viewsets.ModelViewSet):
@@ -237,8 +237,9 @@ handler500 = views.error500_view
urlpatterns = [
re_path(r'^o/authorize/$', base.AuthorizationView.as_view(), name="authorize"),
re_path(r'^o/token/$', base.TokenView.as_view(), name="token"),
re_path(r'^oauth2/', include('provider.oauth2.urls', namespace = 'oauth2')),
# re_path(r'^o/authorize/$', base.AuthorizationView.as_view(), name="authorize"),
# re_path(r'^o/token/$', base.TokenView.as_view(), name="token"),
re_path(r'^', include(router.urls)),
re_path(r'^api-docs/$', views.schema_view, name='schema_view'),
re_path(r'^api-auth/', include('rest_framework.urls',

View File

@@ -1,4 +1,4 @@
from django.utils.encoding import force_bytes, force_text
from django.utils.encoding import force_bytes, force_str
from rowers.tokens import account_activation_token
from django.contrib.sites.shortcuts import get_current_site
from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode
@@ -782,7 +782,7 @@ def downgrade_completed_view(request):
def useractivate(request, uidb64, token): # pragma: no cover
try:
uid = force_text(urlsafe_base64_decode(uidb64))
uid = force_str(urlsafe_base64_decode(uidb64))
user = User.objects.get(id=uid)
except(TypeError, ValueError, OverflowError, User.DoesNotExist):
user = None

View File

@@ -298,7 +298,7 @@ import stravalib
from stravalib.exc import ActivityUploadFailed, TimeoutExceeded
from rowers.weather import get_wind_data, get_airport_code, get_metar_data
from oauth2_provider.models import Application, Grant, AccessToken
# from oauth2_provider.models import Application, Grant, AccessToken
import django_rq
queue = django_rq.get_queue('default')