Compare commits

..

20 Commits

Author SHA1 Message Date
Erik Kalkoken
c2f69cd7e6 Merge branch 'seperate-out-celery-once' into 'master'
Remove dependecies from celery_once customizations

See merge request allianceauth/allianceauth!1491
2025-11-03 02:42:00 +01:00
Ariel Rin
5d56f0a66c Merge branch 'limit-max-python-version' into 'master'
[CHANGE] Limit max. Python version to what we test for

See merge request allianceauth/allianceauth!1773
2025-10-29 10:41:46 +00:00
Ariel Rin
0fbdbf3a8d Merge branch 'sidebar-total-notification-counter' into 'master'
Sidebar total notification counter

See merge request allianceauth/allianceauth!1774
2025-10-29 10:31:51 +00:00
Ariel Rin
5291bf6896 Merge branch 'translation-fixes' into 'master'
[FIX] Django `makemessages` is ignoring f-strings for translations now

See merge request allianceauth/allianceauth!1772
2025-10-29 00:23:39 +00:00
Ariel Rin
bd6c0fede5 Merge branch 'fix-directories' into 'master'
[HOTFIX] Directories

See merge request allianceauth/allianceauth!1775
2025-10-29 00:23:04 +00:00
Peter Pfeufer
23fe1703c3
[FIX] Directories 2025-10-28 22:33:33 +01:00
Peter Pfeufer
9139b0da56
[CHANGE] JS filename to better reflect what it is for 2025-10-28 09:41:33 +01:00
Peter Pfeufer
80145b313f
[ADD] Total notification counter to sidebar 2025-10-28 09:38:20 +01:00
Peter Pfeufer
e96bdd12f9
[CHANGE] Limit max. Python version to what we test for 2025-10-27 11:23:03 +01:00
Joel Falknau
513b7b88f4
another trixie runner, not available to python 3.8 2025-10-27 20:08:15 +10:00
Joel Falknau
5e3fc5c1cb
i dont understand this behaviour but okay fine 2025-10-27 19:51:29 +10:00
Ariel Rin
d3069db046 Merge branch 'srp_allow-missing-trailling-slash' into 'master'
SRP - Allow zkillboard links without a trailling slash to be pasted without errors

See merge request allianceauth/allianceauth!1771
2025-10-26 06:26:48 +00:00
Ariel Rin
24863eaf9e Merge branch 'srp_diplay-errors' into 'master'
SRP - Display form errors

See merge request allianceauth/allianceauth!1770
2025-10-26 06:25:27 +00:00
Joel Falknau
d138bd61c5
py38 not available on debian trixie 2025-10-26 12:45:49 +10:00
Joel Falknau
bff20ddd5d
remove deprecated future 2025-10-26 11:25:06 +10:00
Joel Falknau
493e694410
update precommit 2025-10-26 11:24:57 +10:00
Peter Pfeufer
8c41d9da58
[FIX] Django makemessages is ignoring f-strings for translations now 2025-10-25 11:14:41 +02:00
Joel Falknau
9e0358a3ce
bump test images to trixie 2025-10-25 18:39:24 +10:00
T'rahk Rokym
19bb6856a2 Allow zkillboard links without a trailling slash to be pasted without errors 2025-10-18 00:02:29 +02:00
T'rahk Rokym
9751315b97 Cleaner error display applied to any bootstrap_form in allianceauth
Credit to @ppfeufer for the code snipet
2025-10-17 23:15:42 +02:00
14 changed files with 138 additions and 46 deletions

View File

@ -25,7 +25,7 @@ before_script:
pre-commit-check:
<<: *only-default
stage: pre-commit
image: python:3.11-bookworm
image: python:3.11-trixie
# variables:
# PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
# cache:
@ -65,7 +65,7 @@ test-3.8-core:
test-3.9-core:
<<: *only-default
image: python:3.9-bookworm
image: python:3.9-trixie
script:
- tox -e py39-core
artifacts:
@ -77,7 +77,7 @@ test-3.9-core:
test-3.10-core:
<<: *only-default
image: python:3.10-bookworm
image: python:3.10-trixie
script:
- tox -e py310-core
artifacts:
@ -89,7 +89,7 @@ test-3.10-core:
test-3.11-core:
<<: *only-default
image: python:3.11-bookworm
image: python:3.11-trixie
script:
- tox -e py311-core
artifacts:
@ -101,7 +101,7 @@ test-3.11-core:
test-3.12-core:
<<: *only-default
image: python:3.12-bookworm
image: python:3.12-trixie
script:
- tox -e py312-core
artifacts:
@ -125,7 +125,7 @@ test-3.8-all:
test-3.9-all:
<<: *only-default
image: python:3.9-bookworm
image: python:3.9-trixie
script:
- tox -e py39-all
artifacts:
@ -137,7 +137,7 @@ test-3.9-all:
test-3.10-all:
<<: *only-default
image: python:3.10-bookworm
image: python:3.10-trixie
script:
- tox -e py310-all
artifacts:
@ -149,7 +149,7 @@ test-3.10-all:
test-3.11-all:
<<: *only-default
image: python:3.11-bookworm
image: python:3.11-trixie
script:
- tox -e py311-all
artifacts:
@ -162,7 +162,7 @@ test-3.11-all:
test-3.12-all:
<<: *only-default
image: python:3.12-bookworm
image: python:3.12-trixie
script:
- tox -e py312-all
artifacts:
@ -174,7 +174,7 @@ test-3.12-all:
build-test:
stage: test
image: python:3.11-bookworm
image: python:3.11-trixie
before_script:
- python -m pip install --upgrade pip
@ -193,13 +193,13 @@ build-test:
test-docs:
<<: *only-default
image: python:3.11-bookworm
image: python:3.11-trixie
script:
- tox -e docs
deploy_production:
stage: deploy
image: python:3.11-bookworm
image: python:3.11-trixie
before_script:
- python -m pip install --upgrade pip

View File

@ -84,7 +84,7 @@ repos:
args:
- --indent=4
additional_dependencies:
- tox==4.31.0 # https://github.com/tox-dev/tox/releases/latest
- tox==4.32.0 # https://github.com/tox-dev/tox/releases/latest
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.24.1
hooks:

View File

@ -320,8 +320,8 @@ def click_fatlink_view(request, token, fat_hash=None):
messages.warning(
request,
_(
f"Cannot register the fleet participation for {character.character_name}. The character needs to be online."
),
"Cannot register the fleet participation for {character_name}. The character needs to be online."
).format(character_name=character.character_name)
)
return redirect('fatlink:view')

View File

@ -47,6 +47,12 @@
/* Side Navigation
------------------------------------------------------------------------------------- */
@media all {
.sidemenu-total-notifications-badge {
position: absolute;
left: 28px;
font-size: 42.5% !important;
}
#sidebar > div {
width: 325px;
}

View File

@ -1,4 +1,4 @@
from __future__ import annotations
from __future__ import annotations # Still needed for Python 3.8, replaced with better implementations in Py39+
import logging
from typing import TYPE_CHECKING

View File

@ -11,10 +11,10 @@ environment =
[program:beat]
command = %(ENV_AA_COMMAND_CELERY)s
-A %(ENV_AA_PROJECT_NAME)s beat
directory = %(ENV_AA_VENV_DIRECTORY)s
directory = %(ENV_AA_PROJECT_DIRECTORY)s
user = %(ENV_AA_USER)s
stdout_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stdout_logfile = %(ENV_AA_PROJECT_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = %(ENV_AA_PROJECT_DIRECTORY)s/log/%(program_name)s.log
autostart = true
autorestart = true
startsecs = 10
@ -26,12 +26,12 @@ command = %(ENV_AA_COMMAND_CELERY)s
--pool=threads
--concurrency=5
-n %(program_name)s_%(process_num)02d
directory = %(ENV_AA_VENV_DIRECTORY)s
directory = %(ENV_AA_PROJECT_DIRECTORY)s
user = %(ENV_AA_USER)s
numprocs = 1
process_name = %(program_name)s_%(process_num)02d
stdout_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stdout_logfile = %(ENV_AA_PROJECT_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = %(ENV_AA_PROJECT_DIRECTORY)s/log/%(program_name)s.log
autostart = true
autorestart = true
startsecs = 10
@ -42,12 +42,12 @@ priority = 998
{% if gunicorn %}
[program:gunicorn]
user = %(ENV_AA_USER)s
directory = %(ENV_AA_VENV_DIRECTORY)s
directory = %(ENV_AA_PROJECT_DIRECTORY)s
command = %(ENV_AA_COMMAND_GUNICORN)s %(ENV_AA_PROJECT_NAME)s.wsgi
--workers=3
--timeout 120
stdout_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/%(program_name)s.log
stdout_logfile = %(ENV_AA_PROJECT_DIRECTORY)s/log/%(program_name)s.log
stderr_logfile = %(ENV_AA_PROJECT_DIRECTORY)s/log/%(program_name)s.log
autostart = true
autorestart = true
stopsignal = INT
@ -57,10 +57,10 @@ stopsignal = INT
command = %(ENV_AA_COMMAND_MEMMON)s
-p worker_00=256MB
-p gunicorn=256MB
directory = %(ENV_AA_VENV_DIRECTORY)s
directory = %(ENV_AA_PROJECT_DIRECTORY)s
events = TICK_60
stdout_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/memmon.log
stderr_logfile = %(ENV_AA_VENV_DIRECTORY)s/log/memmon.log
stdout_logfile = %(ENV_AA_PROJECT_DIRECTORY)s/log/memmon.log
stderr_logfile = %(ENV_AA_PROJECT_DIRECTORY)s/log/memmon.log
[group:{{ project_name }}]
programs = beat,worker{% if gunicorn %},gunicorn{% endif %}

View File

@ -100,7 +100,10 @@ class BaseSetPasswordServiceAccountView(ServicesCRUDMixin, BaseServiceView, Upda
def post(self, request, *args, **kwargs):
result = super().post(request, *args, **kwargs)
if self.get_form().is_valid():
messages.success(request, _(f"Successfully set your {self.service_name} password"))
messages.success(
request,
_("Successfully set your {service_name} password").format(service_name=self.service_name)
)
return result

View File

@ -34,6 +34,9 @@ class SrpFleetUserRequestForm(forms.Form):
_("Invalid Link. Please use zkillboard.com or kb.evetools.org")
)
if re.match(r"^http[s]?:\/\/zkillboard\.com\/", data) and not data.endswith("/"):
data += "/"
# Check if it's an actual kill mail
if not any(
re.match(regex, data)

View File

@ -0,0 +1,27 @@
from django.test import TestCase
from allianceauth.srp.form import SrpFleetUserRequestForm
class TestForms(TestCase):
def test_allow_missing_trailing_slash_zkillboard(self):
form = SrpFleetUserRequestForm(
data = {
"killboard_link": "https://zkillboard.com/kill/130429493",
"additional_info": "Details",
}
)
form.cleaned_data = {"killboard_link": "https://zkillboard.com/kill/130429493"}
self.assertEqual("https://zkillboard.com/kill/130429493/", form.clean_killboard_link())
def test_not_add_trailling_slash_kb_evetools(self):
form = SrpFleetUserRequestForm(
data = {
"killboard_link": "https://kb.evetools.org/kill/130429493",
}
)
form.cleaned_data = {"killboard_link": "https://kb.evetools.org/kill/130429493"}
self.assertEqual("https://kb.evetools.org/kill/130429493", form.clean_killboard_link())

View File

@ -1,13 +0,0 @@
$(document).ready(() => {
'use strict';
const activeChildMenuItem = document.querySelector('ul#sidebar-menu ul.collapse a.active');
if (activeChildMenuItem) {
const activeChildMenuUl = activeChildMenuItem.closest('ul');
activeChildMenuUl.classList.add('show');
document.querySelectorAll(`[data-bs-target^="#${activeChildMenuUl.id}"]`)
.forEach(element => element.setAttribute('aria-expanded', true));
}
});

View File

@ -0,0 +1,57 @@
$(document).ready(() => {
'use strict';
/**
* Collect all badges in the sidebar menu that are not part of a collapsible submenu, and calculate the total notification count.
* Show a total notification badge in the navbar if there are any notifications.
*/
const totalNotificationsBadge = () => {
const badges = [];
let notificationCount = 0;
document.querySelectorAll('#sidebar-menu .badge').forEach(b => {
const li = b.closest('li');
if (!li || !li.querySelector('ul.collapse')) {
badges.push(b);
notificationCount += parseInt(b.textContent);
}
});
if (badges.length > 0 && notificationCount > 0) {
const notificationBadge = document.createElement('span');
notificationBadge.classList.add(
'badge',
'text-bg-danger',
'align-self-center',
'sidemenu-notification-badge',
'sidemenu-total-notifications-badge'
);
notificationBadge.textContent = String(notificationCount);
document.querySelector('a.navbar-brand i.fa-solid').prepend(notificationBadge);
}
};
/**
* Find the active child menu item in the sidebar menu, if any, and ensure its parent submenu is expanded.
*/
const expandChildMenu = () => {
const activeChildMenuItem = document.querySelector('ul#sidebar-menu ul.collapse a.active');
if (activeChildMenuItem) {
const activeChildMenuUl = activeChildMenuItem.closest('ul');
activeChildMenuUl.classList.add('show');
document.querySelectorAll(`[data-bs-target^="#${activeChildMenuUl.id}"]`)
.forEach(element => element.setAttribute('aria-expanded', 'true'));
}
};
// Execute functions on document ready
[
totalNotificationsBadge,
expandChildMenu
].forEach(fn => fn());
});

View File

@ -1,3 +1,3 @@
{% load sri %}
{% sri_static 'allianceauth/js/sidebar-collapse.js' %}
{% sri_static 'allianceauth/js/sidebar.js' %}

View File

@ -0,0 +1,11 @@
{# Template override to display the errors of django Forms when using `boostrap_form` form the `django-bootstrap5` #}
{# library. #}
{# See: https://github.com/zostera/django-bootstrap5/pull/767 #}
{% if field_errors %}
<div id="{{ field.auto_id }}_error" class="invalid-feedback">
{% for text in field_errors %}
<div>{{ text }}</div>
{% endfor %}
</div>
{% endif %}

View File

@ -15,7 +15,7 @@ license = { file = "LICENSE" }
authors = [
{ name = "Alliance Auth", email = "adarnof@gmail.com" },
]
requires-python = ">=3.8"
requires-python = ">=3.8,<3.13"
classifiers = [
"Environment :: Web Environment",
"Framework :: Celery",
@ -31,8 +31,6 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
]