Compare commits

...

5 Commits

Author SHA1 Message Date
Ariel Rin
3935a9cdd2 Version Bump 4.0.0b2 2024-02-24 14:44:49 +10:00
Ariel Rin
49fb6c39d5 Merge branch 'navactive' into 'v4.x'
Errors thrown here cause 404 error handling to fail. 404s cant url resolve.

See merge request allianceauth/allianceauth!1598
2024-02-24 04:42:48 +00:00
Ariel Rin
8821f18b21 Errors thrown here cause 404 error handling to fail. 404s cant url resolve. 2024-02-24 04:42:48 +00:00
Ariel Rin
1c7f8256d0 Merge branch 'fix-filenames' into 'v4.x'
[AA4] Fix dots in file names

See merge request allianceauth/allianceauth!1597
2024-02-22 03:00:47 +00:00
Erik Kalkoken
61f0aae5d9 [AA4] Fix dots in file names 2024-02-22 03:00:47 +00:00
7 changed files with 38 additions and 32 deletions

View File

@@ -5,7 +5,7 @@ manage online service access.
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
__version__ = '4.0.0b1'
__version__ = '4.0.0b2'
__title__ = 'Alliance Auth'
__url__ = 'https://gitlab.com/allianceauth/allianceauth'
NAME = f'{__title__} v{__version__}'

View File

@@ -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):

View File

@@ -23,6 +23,7 @@ THE SOFTWARE.
"""
from django.template import Library
from django.urls import resolve
from django.urls.exceptions import Resolver404
from django.conf import settings
import re
@@ -45,19 +46,23 @@ def navactive(request, urls):
{% navactive request "view_name another_view_name" %}
"""
url_list = set(urls.split())
resolved = resolve(request.path)
resolved_urls = set()
if resolved.url_name:
resolved_urls.add(resolved.url_name)
if resolved.namespaces:
resolved_urls = resolved_urls.union([f"{namespace}:{resolved.url_name}" for namespace in resolved.namespaces])
resolved_urls = resolved_urls.union([f"{namespace}:" for namespace in resolved.namespaces])
if getattr(resolved, 'app_name', None):
resolved_urls = resolved_urls.union([f"{resolved.app_name}:{resolved.url_name}", f"{resolved.app_name}:"])
if getattr(resolved, 'app_names', []):
resolved_urls = resolved_urls.union([f"{app_name}:{resolved.url_name}" for app_name in resolved.app_names])
resolved_urls = resolved_urls.union([f"{app_name}:" for app_name in resolved.app_names])
if url_list and resolved_urls and bool(resolved_urls & url_list):
return getattr(settings, "NAVHELPER_ACTIVE_CLASS", "active")
try:
resolved = resolve(request.path)
resolved_urls = set()
if resolved.url_name:
resolved_urls.add(resolved.url_name)
if resolved.namespaces:
resolved_urls = resolved_urls.union(
[f"{namespace}:{resolved.url_name}" for namespace in resolved.namespaces])
resolved_urls = resolved_urls.union([f"{namespace}:" for namespace in resolved.namespaces])
if getattr(resolved, 'app_name', None):
resolved_urls = resolved_urls.union([f"{resolved.app_name}:{resolved.url_name}", f"{resolved.app_name}:"])
if getattr(resolved, 'app_names', []):
resolved_urls = resolved_urls.union([f"{app_name}:{resolved.url_name}" for app_name in resolved.app_names])
resolved_urls = resolved_urls.union([f"{app_name}:" for app_name in resolved.app_names])
if url_list and resolved_urls and bool(resolved_urls & url_list):
return getattr(settings, "NAVHELPER_ACTIVE_CLASS", "active")
except Resolver404:
pass
# 404 errors can't url resolve
return getattr(settings, "NAVHELPER_NOT_ACTIVE_CLASS", "")

View File

@@ -1,7 +1,7 @@
PROTOCOL=https://
AUTH_SUBDOMAIN=%AUTH_SUBDOMAIN%
DOMAIN=%DOMAIN%
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.0.0b1
AA_DOCKER_TAG=registry.gitlab.com/allianceauth/allianceauth/auth:v4.0.0b2
# Nginx Proxy Manager
PROXY_HTTP_PORT=80

View File

@@ -1,5 +1,5 @@
FROM python:3.11-slim
ARG AUTH_VERSION=v4.0.0b1
ARG AUTH_VERSION=v4.0.0b2
ARG AUTH_PACKAGE=allianceauth==${AUTH_VERSION}
ENV AUTH_USER=allianceauth
ENV AUTH_GROUP=allianceauth