Skip to content

Commit

Permalink
compatible with invite link from takahe
Browse files Browse the repository at this point in the history
  • Loading branch information
mein Name authored and alphatownsman committed Feb 9, 2025
1 parent 2d7ff41 commit f4075f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,7 @@
path("me/", me, name="me"),
path("nodeinfo/2.0/", nodeinfo2),
path("developer/", console, name="developer"),
path("auth/signup/", signup, name="signup"),
path("auth/signup/<str:code>/", signup, name="signup"),
re_path("^~neodb~(?P<uri>.+)", ap_redirect),
]
8 changes: 8 additions & 0 deletions common/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,11 @@ def console(request):
"openapi_json_url": reverse(f"{api.urls_namespace}:openapi-json"),
}
return render(request, "console.html", context)


def signup(request, code: str | None = None):
if request.user.is_authenticated:
return redirect(reverse("common:home"))
if code:
return redirect(reverse("users:login") + "?invite=" + code)
return redirect(reverse("users:login"))

0 comments on commit f4075f5

Please sign in to comment.