Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AlekSIS/official/AlekSIS-App-Resint
  • sunweaver/AlekSIS-App-Resint
2 results
Show changes
Commits on Source (3)
from typing import Any, Dict, List, Type
from typing import Any
from django.contrib.contenttypes.models import ContentType
from django.db.models import QuerySet
......@@ -92,14 +92,14 @@ class PosterListView(PermissionRequiredMixin, ListView):
posters = get_objects_for_user(self.request.user, "resint.view_poster", qs)
return qs.filter(group__in=allowed_groups) | posters
def get_context_data(self, **kwargs: Any) -> Dict[str, Any]:
def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
context = super().get_context_data(**kwargs)
context["poster_groups"] = PosterGroup.objects.all().order_by("name")
return context
class RequestMixin:
def get_form_kwargs(self) -> Dict[str, Any]:
def get_form_kwargs(self) -> dict[str, Any]:
kwargs = super().get_form_kwargs()
kwargs["request"] = self.request
return kwargs
......@@ -201,7 +201,7 @@ class LiveDocumentCreateView(PermissionRequiredMixin, AdvancedCreateView):
class LiveDocumentEditView(PermissionRequiredMixin, AdvancedEditView):
"""Edit view for live documents."""
def get_form_class(self) -> Type[BaseModelForm]:
def get_form_class(self) -> type[BaseModelForm]:
return modelform_factory(self.object.__class__, fields=self.fields)
model = LiveDocument
......@@ -247,6 +247,6 @@ class LiveDocumentShowAPIView(
):
"""Show the current version of the live document in API."""
def get_scopes(self, *args, **kwargs) -> List[str]:
def get_scopes(self, *args, **kwargs) -> list[str]:
"""Return the scope needed to access the PDF file."""
return [self.get_object().scope]
......@@ -20,7 +20,7 @@ authors = [
"Frank Poetzsch-Heffter <p-h@katharineum.de>",
"Jonathan Weth <dev@jonathanweth.de>"
]
maintainers = ["Jonathan Weth <dev@jonathanweth.de>", "Dominik George <dominik.george@teckids.org>"]
maintainers = ["Jonathan Weth <jonathan.weth@teckids.org>", "Dominik George <dominik.george@teckids.org>"]
license = "EUPL-1.2-or-later"
homepage = "https://aleksis.org"
repository = "https://edugit.org/AlekSIS/official/AlekSIS-App-Resint"
......@@ -39,7 +39,6 @@ priority = "primary"
name = "gitlab"
url = "https://edugit.org/api/v4/projects/461/packages/pypi/simple"
priority = "supplemental"
[tool.poetry.dependencies]
python = "^3.10"
AlekSIS-Core = "^4.0.0.dev11"
......@@ -52,18 +51,16 @@ resint = "aleksis.apps.resint.apps:ResintConfig"
django-stubs = "^4.2"
safety = "^2.3.5"
ruff = "^0.1.5"
curlylint = "^0.13.0"
ruff = "^0.8.2"
[tool.poetry.group.test.dependencies]
pytest = "^7.2"
pytest-django = "^4.1"
pytest = "^8.3"
pytest-django = "^4.9"
pytest-django-testing-postgresql = "^0.2"
pytest-cov = "^4.0.0"
pytest-sugar = "^0.9.2"
selenium = "<4.10.0"
freezegun = "^1.1.0"
pytest-cov = "^6.0.0"
pytest-sugar = "^1.0.0"
selenium = "^4.27.0"
freezegun = "^1.5.0"
[tool.poetry.group.docs]
optional = true
......@@ -74,21 +71,22 @@ sphinxcontrib-django = "^2.3.0"
sphinxcontrib-svg2pdfconverter = "^1.1.1"
sphinx-autodoc-typehints = "^1.7"
sphinx_material = "^0.0.35"
[tool.ruff]
exclude = ["migrations", "tests"]
exclude = ["migrations"]
line-length = 100
[tool.ruff.lint]
select = ["E", "F", "UP", "B", "SIM", "I", "DJ", "A", "S"]
ignore = ["UP034", "UP015", "B028"]
[tool.ruff.isort]
[tool.ruff.lint.extend-per-file-ignores]
"**/*/tests/**/*.py" = ["S101", "ARG", "FBT", "PLR2004", "S311", "S105"]
[tool.ruff.lint.isort]
known-first-party = ["aleksis"]
section-order = ["future", "standard-library", "django", "third-party", "first-party", "local-folder"]
[tool.ruff.isort.sections]
[tool.ruff.lint.isort.sections]
django = ["django"]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"