Merge pull request 'Update to django 5.2 to support python 3.14' (#96) from master into stage
Deploy into stage environment / Deploy into stage environment (push) Successful in 2s
Run tests / Execute tox to run the test suite (push) Successful in 4m2s

Reviewed-on: #96
This commit was merged in pull request #96.
This commit is contained in:
2026-04-29 13:59:10 +02:00
6 changed files with 21 additions and 16 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import logging
import secrets
from django.apps import apps
from django.core.exceptions import ValidationError
from django.contrib import messages
@@ -82,13 +83,15 @@ class CreateAndSendPasswordView(generic.FormView):
form_class = forms.CreateAndSendPasswordForm
template_name = 'dav_auth/forms/recreate_password.html'
success_url = reverse_lazy('dav_auth:login')
password_chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789#$%&@^~.,:;/_-*+!?'
password_length = 32
def form_valid(self, form):
username = form.cleaned_data.get('username')
user_model = get_user_model()
try:
user = user_model.objects.get(username=username)
random_password = user_model.objects.make_random_password(length=32)
random_password = ''.join(secrets.choice(self.password_chars) for i in range(self.password_length))
user.set_password(random_password)
user.save()
email = emails.PasswordSetEmail(user, random_password)
+2 -2
View File
@@ -1,6 +1,6 @@
import json
import os
import pkg_resources
from importlib.resources import files as resource_files
from django.conf import settings
from django.urls import re_path, include
@@ -65,7 +65,7 @@ class ModuleMeta:
def _load_from_package(self):
package_name = self._package_name
json_text = pkg_resources.resource_string(package_name, self._json_file)
json_text = resource_files(package_name).joinpath(self._json_file).read_bytes()
meta_dict = json.loads(json_text)
meta_dict['package'] = package_name
self.load_from_dict(meta_dict)
+7 -7
View File
@@ -2,7 +2,7 @@ import argparse
import os
import posix
import sys
import pkg_resources
from importlib.resources import files as resource_files
from django.core.management import execute_from_command_line
from dav_base.config.modules import DJANGO_MAIN_MODULE, ModuleConfig
@@ -94,20 +94,20 @@ class AdminCommand: # pylint: disable=too-few-public-methods
config = ModuleConfig(django_base_dir=django_base_dir)
config.save()
input_file = os.path.join('django_project_config', 'additional_settings.py')
input_file = resource_files(__package__).joinpath('django_project_config', 'additional_settings.py')
output_file = os.path.join(django_base_dir, django_main_module, 'settings.py')
with open(output_file, 'ab') as f:
f.write(pkg_resources.resource_string(__package__, input_file))
f.write(input_file.read_bytes())
input_file = os.path.join('django_project_config', 'urls.py')
input_file = resource_files(__package__).joinpath('django_project_config', 'urls.py')
output_file = os.path.join(django_base_dir, django_main_module, 'urls.py')
with open(output_file, 'wb') as f:
f.write(pkg_resources.resource_string(__package__, input_file))
f.write(input_file.read_bytes())
input_file = os.path.join('django_project_config', 'settings-dav_base.py')
input_file = resource_files(__package__).joinpath('django_project_config', 'settings-dav_base.py')
output_file = os.path.join(django_base_dir, django_main_module, 'settings-dav_base.py')
with open(output_file, 'wb') as f:
f.write(pkg_resources.resource_string(__package__, input_file))
f.write(input_file.read_bytes())
return posix.EX_OK
@@ -1,5 +1,5 @@
import os
import pkg_resources
from importlib.resources import files as resource_files
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
@@ -23,12 +23,12 @@ class Command(BaseCommand):
raise CommandError('Module \'{}\' is already enabled'.format(module_name))
settings_file_name = 'settings-{}.py'.format(module_name)
input_file = os.path.join('django_project_config', settings_file_name)
if pkg_resources.resource_exists(module_name, input_file):
input_file = resource_files(module_name).joinpath('django_project_config', settings_file_name)
if input_file.is_file():
output_file = os.path.join(django_base_dir, django_main_module, settings_file_name)
if not os.path.exists(output_file):
with open(output_file, 'wb') as f:
f.write(pkg_resources.resource_string(module_name, input_file))
f.write(input_file.read_bytes())
module_meta_obj = ModuleMeta(module_name)
config.modules[module_name] = module_meta_obj
@@ -3,6 +3,8 @@
{{ normalized_short_date }}
{% if alt_normalized_short_date %}({% trans 'Ersatztermin' %}: {{ alt_normalized_short_date }})
{% endif %}
{% if trainer_email or trainer_phone %}{% if trainer_email %}{{ trainer_email }}{% endif %}{% if trainer_email and trainer_phone %}, {% endif %}{% if trainer_phone %}{{ trainer_phone }}{% endif %}
{% endif %}
{{ description }}
{% if mode == 'training' %}
{% trans 'Kursinhalte' %}:
@@ -44,5 +46,5 @@
{% endif %}{% if charge > 0 or additional_costs %}{% trans 'Kosten' %}: {% if charge > 0 %}{{ charge|floatformat:'-2' }} € {% trans 'Teilnahmegebühr' %}{% endif %}{% if additional_costs %}{% if charge > 0 %} {% trans 'zzgl.' %} {% endif %}{{ additional_costs }}{% endif %}
{% endif %}{% if registration_required and deadline %}{% trans 'Anmeldeschluss' %}: {{ deadline|date:'D, j. N Y' }}
{% endif %}{% if trainer_2_fullname %}{% if mode == 'training' %}{% trans 'Ausbildungsteam' %}:{% else %}{% trans 'Team' %}:{% endif %} {{ trainer_firstname }} {{ trainer_familyname }}, {{ trainer_2_fullname }}{% if trainer_3_fullname %}, {{ trainer_3_fullname }}{% endif %}
{% endif %}{% if trainer_familyname %}{% trans 'Leitung' %}: {{ trainer_firstname }} {{ trainer_familyname }}{% if trainer_email or trainer_phone %} ({% if trainer_email %}{{ trainer_email }}{% endif %}{% if trainer_email and trainer_phone %}, {% endif %}{% if trainer_phone %}{{ trainer_phone }}{% endif %}){% endif %}
{% endif %}{% if trainer_familyname %}{% trans 'Leitung' %}: {{ trainer_firstname }} {{ trainer_familyname }}
{% endif %}
+1 -1
View File
@@ -1,5 +1,5 @@
babel
django<5.1
django<6
django-bootstrap3
django-countries
django-datetime-widget2