Ran pre-commit run --all-files.
This commit is contained in:
parent
c9b0c19fec
commit
d31d31485c
9 changed files with 13 additions and 12 deletions
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from django.contrib.auth.models import Permission as DjangoPermission
|
from django.contrib.auth.models import Permission as DjangoPermission
|
||||||
from django.contrib.contenttypes.models import ContentType
|
from django.contrib.contenttypes.models import ContentType
|
||||||
|
|
|
@ -25,9 +25,9 @@ from .selectors import get_memberships
|
||||||
from .selectors import get_subscription_periods
|
from .selectors import get_subscription_periods
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from utils.types import AuthenticatedHttpRequest
|
|
||||||
from django.http import HttpRequest
|
from django.http import HttpRequest
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
from utils.types import AuthenticatedHttpRequest
|
||||||
|
|
||||||
member_view = namespaced_decorator_factory(namespace="member", base_path="membership")
|
member_view = namespaced_decorator_factory(namespace="member", base_path="membership")
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ from services.registry import ServiceRegistry
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from utils.types import AuthenticatedHttpRequest
|
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
|
from utils.types import AuthenticatedHttpRequest
|
||||||
|
|
||||||
services_view = namespaced_decorator_factory(
|
services_view = namespaced_decorator_factory(
|
||||||
namespace="services",
|
namespace="services",
|
||||||
|
@ -34,7 +34,9 @@ def services_overview(request: AuthenticatedHttpRequest) -> HttpResponse:
|
||||||
|
|
||||||
active_service_classes = [service.__class__ for service in active_services]
|
active_service_classes = [service.__class__ for service in active_services]
|
||||||
|
|
||||||
non_active_services = [service for _, service in ServiceRegistry.get_items() if service not in active_service_classes]
|
non_active_services = [
|
||||||
|
service for _, service in ServiceRegistry.get_items() if service not in active_service_classes
|
||||||
|
]
|
||||||
|
|
||||||
context = {
|
context = {
|
||||||
"non_active_services": non_active_services,
|
"non_active_services": non_active_services,
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
"""Command to bootstrap development data."""
|
"""Command to bootstrap development data."""
|
||||||
|
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
from django.utils import timezone
|
|
||||||
from django.db.backends.postgresql.psycopg_any import DateRange
|
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.core.management import BaseCommand
|
from django.core.management import BaseCommand
|
||||||
|
from django.db.backends.postgresql.psycopg_any import DateRange
|
||||||
|
from django.utils import timezone
|
||||||
from membership.models import SubscriptionPeriod
|
from membership.models import SubscriptionPeriod
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,5 +7,4 @@ from django.http import HttpRequest
|
||||||
class AuthenticatedHttpRequest(HttpRequest):
|
class AuthenticatedHttpRequest(HttpRequest):
|
||||||
"""HttpRequest with an authenticated user."""
|
"""HttpRequest with an authenticated user."""
|
||||||
|
|
||||||
# XXX(reynir): Should this be Member instead?!
|
|
||||||
user: User
|
user: User
|
||||||
|
|
|
@ -89,7 +89,6 @@ class RenderConfig:
|
||||||
for obj in objects:
|
for obj in objects:
|
||||||
with queries_disabled():
|
with queries_disabled():
|
||||||
row = Row(
|
row = Row(
|
||||||
# XXX(reynir): we never use the key
|
|
||||||
data={column[0]: getattr(obj, column[0]) for column in columns},
|
data={column[0]: getattr(obj, column[0]) for column in columns},
|
||||||
actions=[action.render(obj) for action in row_actions],
|
actions=[action.render(obj) for action in row_actions],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue