mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2025-12-06 04:41:41 +01:00
Compare commits
8 Commits
99df847e1f
...
d3069db046
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3069db046 | ||
|
|
24863eaf9e | ||
|
|
d138bd61c5 | ||
|
|
bff20ddd5d | ||
|
|
493e694410 | ||
|
|
9e0358a3ce | ||
|
|
19bb6856a2 | ||
|
|
9751315b97 |
@ -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:
|
||||
@ -113,7 +113,7 @@ test-3.12-core:
|
||||
|
||||
test-3.8-all:
|
||||
<<: *only-default
|
||||
image: python:3.8-bookworm
|
||||
image: python:3.8-trixie
|
||||
script:
|
||||
- tox -e py38-all
|
||||
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
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
27
allianceauth/srp/tests/test_form.py
Normal file
27
allianceauth/srp/tests/test_form.py
Normal 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())
|
||||
11
allianceauth/templates/django_bootstrap5/field_errors.html
Normal file
11
allianceauth/templates/django_bootstrap5/field_errors.html
Normal 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 %}
|
||||
Loading…
x
Reference in New Issue
Block a user