Skip to content

Commit 0072b64

Browse files
authored
/login: ensure next is always set (#1738)
This to avoid the following exception when we use a Django user: ``` Using the URLconf defined in ansible_ai_connect.main.urls, Django tried these URL patterns, in this order: [name='home'] login/<str:backend>/ [name='begin'] The current path, login/None/, matched the last one. ```
1 parent ba48b5a commit 0072b64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ansible_ai_connect/main/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
class LoginView(auth_views.LoginView):
5252
def get_context_data(self, **kwargs):
5353
context = super().get_context_data(**kwargs)
54-
context["next"] = self.request.GET.get("next")
54+
context["next"] = self.request.GET.get("next") or "/"
5555
context["deployment_mode"] = settings.DEPLOYMENT_MODE
5656
context["project_name"] = settings.ANSIBLE_AI_PROJECT_NAME
5757
context["aap_api_provider_name"] = settings.AAP_API_PROVIDER_NAME

0 commit comments

Comments
 (0)