From 61f0aae5d964e9deb1fcc0b3e3c5434f0fef516d Mon Sep 17 00:00:00 2001 From: Erik Kalkoken Date: Thu, 22 Feb 2024 03:00:47 +0000 Subject: [PATCH] [AA4] Fix dots in file names --- ...racters.html => dashboard_characters.html} | 0 ...oard.groups.html => dashboard_groups.html} | 0 allianceauth/authentication/views.py | 29 ++++++++++--------- 3 files changed, 15 insertions(+), 14 deletions(-) rename allianceauth/authentication/templates/authentication/{dashboard.characters.html => dashboard_characters.html} (100%) rename allianceauth/authentication/templates/authentication/{dashboard.groups.html => dashboard_groups.html} (100%) diff --git a/allianceauth/authentication/templates/authentication/dashboard.characters.html b/allianceauth/authentication/templates/authentication/dashboard_characters.html similarity index 100% rename from allianceauth/authentication/templates/authentication/dashboard.characters.html rename to allianceauth/authentication/templates/authentication/dashboard_characters.html diff --git a/allianceauth/authentication/templates/authentication/dashboard.groups.html b/allianceauth/authentication/templates/authentication/dashboard_groups.html similarity index 100% rename from allianceauth/authentication/templates/authentication/dashboard.groups.html rename to allianceauth/authentication/templates/authentication/dashboard_groups.html diff --git a/allianceauth/authentication/views.py b/allianceauth/authentication/views.py index ff66a110..2e8f4e2c 100644 --- a/allianceauth/authentication/views.py +++ b/allianceauth/authentication/views.py @@ -1,8 +1,6 @@ import logging + import requests - -from allianceauth.hooks import get_hooks - from django_registration.backends.activation.views import ( REGISTRATION_SALT, ActivationView as BaseActivationView, RegistrationView as BaseRegistrationView, @@ -34,7 +32,7 @@ from .models import CharacterOwnership if 'allianceauth.eveonline.autogroups' in settings.INSTALLED_APPS: _has_auto_groups = True - from allianceauth.eveonline.autogroups.models import * + from allianceauth.eveonline.autogroups.models import * # noqa: F401, F403 else: _has_auto_groups = False @@ -58,7 +56,7 @@ def dashboard_groups(request): context = { 'groups': groups, } - return render_to_string('authentication/dashboard.groups.html', context=context, request=request) + return render_to_string('authentication/dashboard_groups.html', context=context, request=request) def dashboard_characters(request): @@ -70,7 +68,7 @@ def dashboard_characters(request): context = { 'characters': characters } - return render_to_string('authentication/dashboard.characters.html', context=context, request=request) + return render_to_string('authentication/dashboard_characters.html', context=context, request=request) def dashboard_admin(request): @@ -164,10 +162,12 @@ def main_character_change(request, token): if co: request.user.profile.main_character = co.character request.user.profile.save(update_fields=['main_character']) - messages.success(request, _('Changed main character to %(char)s') % { - "char": co.character}) - logger.info('Changed user %(user)s main character to %(char)s' % - ({'user': request.user, 'char': co.character})) + messages.success(request, _('Changed main character to %s') % co.character) + logger.info( + 'Changed user {user} main character to {char}'.format( + user=request.user, char=co.character + ) + ) return redirect("authentication:dashboard") @@ -222,8 +222,10 @@ def sso_login(request, token): token.delete() messages.error( request, - _('Unable to authenticate as the selected character. ' - 'Please log in with the main character associated with this account.') + _( + 'Unable to authenticate as the selected character. ' + 'Please log in with the main character associated with this account.' + ) ) return redirect(settings.LOGIN_URL) @@ -306,8 +308,7 @@ class RegistrationView(BaseRegistrationView): else: user.is_active = True user.save() - login(self.request, user, - 'allianceauth.authentication.backends.StateBackend') + login(self.request, user, 'allianceauth.authentication.backends.StateBackend') return user def get_activation_key(self, user):