2022-11-17 00:23:46 +00:00
|
|
|
from django.utils.decorators import method_decorator
|
2023-04-27 06:54:38 +00:00
|
|
|
from django.views.generic import View
|
|
|
|
from django.shortcuts import redirect
|
2022-11-17 00:23:46 +00:00
|
|
|
|
2023-04-27 06:54:38 +00:00
|
|
|
from django.contrib.auth.decorators import login_required
|
2023-02-14 03:50:43 +00:00
|
|
|
from users.views.settings.import_export import ( # noqa
|
|
|
|
CsvFollowers,
|
|
|
|
CsvFollowing,
|
|
|
|
ImportExportPage,
|
|
|
|
)
|
2022-12-14 17:15:46 +00:00
|
|
|
from users.views.settings.interface import InterfacePage # noqa
|
2022-11-19 20:38:25 +00:00
|
|
|
from users.views.settings.profile import ProfilePage # noqa
|
2022-11-26 02:33:46 +00:00
|
|
|
from users.views.settings.security import SecurityPage # noqa
|
2022-12-14 17:15:46 +00:00
|
|
|
from users.views.settings.settings_page import SettingsPage # noqa
|
2023-04-28 01:09:16 +00:00
|
|
|
from users.views.settings.follows import FollowsPage # noqa
|
2022-11-17 00:23:46 +00:00
|
|
|
|
|
|
|
|
2023-04-27 06:54:38 +00:00
|
|
|
@method_decorator(login_required, name="dispatch")
|
|
|
|
class SettingsRoot(View):
|
|
|
|
"""
|
|
|
|
Redirects to a root settings page (varying on if there is an identity
|
|
|
|
in the URL or not)
|
|
|
|
"""
|
|
|
|
|
|
|
|
def get(self, request, handle: str | None = None):
|
|
|
|
if handle:
|
|
|
|
return redirect("settings_profile", handle=handle)
|
|
|
|
return redirect("settings_security")
|