mirror of
https://github.com/sissbruecker/linkding
synced 2024-11-22 11:23:02 +00:00
5eadb3ede3
* allow configuring landing page * add tests
18 lines
635 B
Python
18 lines
635 B
Python
from django.http import HttpResponseRedirect
|
|
from django.urls import reverse
|
|
|
|
from bookmarks.models import GlobalSettings
|
|
|
|
|
|
def root(request):
|
|
# Redirect unauthenticated users to the configured landing page
|
|
if not request.user.is_authenticated:
|
|
settings = GlobalSettings.get()
|
|
|
|
if settings.landing_page == GlobalSettings.LANDING_PAGE_SHARED_BOOKMARKS:
|
|
return HttpResponseRedirect(reverse("bookmarks:shared"))
|
|
else:
|
|
return HttpResponseRedirect(reverse("login"))
|
|
|
|
# Redirect authenticated users to the bookmarks page
|
|
return HttpResponseRedirect(reverse("bookmarks:index"))
|