From f6cb28d64baf0870c8392141b5d25566cc6a127f Mon Sep 17 00:00:00 2001 From: Joel Falknau Date: Mon, 30 Dec 2024 20:28:45 +1000 Subject: [PATCH] clarify templinks page --- allianceauth/services/modules/mumble/auth_hooks.py | 13 ++----------- .../services/mumble/{index.html => templinks.html} | 0 allianceauth/services/modules/mumble/urls.py | 2 +- allianceauth/services/modules/mumble/views.py | 3 ++- 4 files changed, 5 insertions(+), 13 deletions(-) rename allianceauth/services/modules/mumble/templates/services/mumble/{index.html => templinks.html} (100%) diff --git a/allianceauth/services/modules/mumble/auth_hooks.py b/allianceauth/services/modules/mumble/auth_hooks.py index f395531d..b57fb6e7 100644 --- a/allianceauth/services/modules/mumble/auth_hooks.py +++ b/allianceauth/services/modules/mumble/auth_hooks.py @@ -37,19 +37,10 @@ class MumbleService(ServicesHook): except MumbleUser.DoesNotExist: logging.debug("User does not have a mumble account") - def update_groups(self, user): - logger.debug(f"Updating {self.name} groups for {user}") - if MumbleTasks.has_account(user): - MumbleTasks.update_groups.delay(user.pk) - def validate_user(self, user): if MumbleTasks.has_account(user) and not self.service_active_for_user(user): self.delete_user(user, notify_user=True) - def update_all_groups(self): - logger.debug("Updating all %s groups" % self.name) - MumbleTasks.update_all_groups.delay() - def service_active_for_user(self, user): return user.has_perm(self.access_perm) @@ -80,8 +71,8 @@ class MumbleMenuItem(MenuItemHook): self=self, text=_("Mumble Temp Links"), classes="fa-solid fa-microphone", - url_name="mumble:index", - navactive=["mumble:index"], + url_name="mumble:templinks", + navactive=["mumble:templinks"], ) def render(self, request) -> str: diff --git a/allianceauth/services/modules/mumble/templates/services/mumble/index.html b/allianceauth/services/modules/mumble/templates/services/mumble/templinks.html similarity index 100% rename from allianceauth/services/modules/mumble/templates/services/mumble/index.html rename to allianceauth/services/modules/mumble/templates/services/mumble/templinks.html diff --git a/allianceauth/services/modules/mumble/urls.py b/allianceauth/services/modules/mumble/urls.py index 4d9a5340..0cb1a9fd 100644 --- a/allianceauth/services/modules/mumble/urls.py +++ b/allianceauth/services/modules/mumble/urls.py @@ -15,7 +15,7 @@ module_urls = [ path('ajax/release_counts_data', views.release_counts_data, name="release_counts_data"), path('ajax/release_pie_chart_data', views.release_pie_chart_data, name="release_pie_chart_data"), # Temp Links - path("", views.index, name="index"), + path("templinks/", views.templinks, name="templinks"), re_path(r"^join/(?P[\w\-]+)/$", views.link, name="join"), re_path(r"^nuke/(?P[\w\-]+)/$", views.nuke, name="nuke"), ] diff --git a/allianceauth/services/modules/mumble/views.py b/allianceauth/services/modules/mumble/views.py index c4e0f126..ed402988 100644 --- a/allianceauth/services/modules/mumble/views.py +++ b/allianceauth/services/modules/mumble/views.py @@ -99,6 +99,7 @@ def release_pie_chart_data(request) -> JsonResponse: "values": list(release_counts.values_list("user_count", flat=True)), }) + class PseudoProfile: def __init__(self, main): self.main_character = main @@ -113,7 +114,7 @@ class PseudoUser: @login_required @permission_required("mumble.create_new_links") -def index(request): +def templinks(request) -> HttpResponse: tl = None if request.method == "POST":