Skip to content

Commit

Permalink
🐛 Django 4.2 support was a lie
Browse files Browse the repository at this point in the history
Probably shadowed by the version range ~= in setup.cfg
  • Loading branch information
sergei-maertens committed Jun 20, 2023
1 parent ed57385 commit 8abd29d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions digid_eherkenning/compat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from django.views import View


def get_next_page(view: View) -> str:
try:
return view.get_default_redirect_url() # type: ignore
except AttributeError:
return view.get_next_page() # type: ignore
3 changes: 2 additions & 1 deletion digid_eherkenning/views/digid.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from onelogin.saml2.utils import OneLogin_Saml2_Error, OneLogin_Saml2_ValidationError

from ..choices import DigiDAssuranceLevels, SectorType
from ..compat import get_next_page
from ..forms import SAML2Form
from ..saml2.digid import DigiDClient
from ..utils import logout_user
Expand Down Expand Up @@ -144,7 +145,7 @@ def dispatch(self, request, *args, **kwargs):
raise PermissionDenied(_("You are not authenticated with Digid"))

client = DigiDClient()
return_to = self.get_next_page()
return_to = get_next_page(self)
logout_url = client.create_logout_request(
request, return_to=return_to, name_id=name_id
)
Expand Down

0 comments on commit 8abd29d

Please sign in to comment.