diff options
Diffstat (limited to 'users')
-rw-r--r-- | users/models/identity.py | 8 | ||||
-rw-r--r-- | users/models/system_actor.py | 4 | ||||
-rw-r--r-- | users/models/user.py | 4 | ||||
-rw-r--r-- | users/views/settings/interface.py | 6 |
4 files changed, 10 insertions, 12 deletions
diff --git a/users/models/identity.py b/users/models/identity.py index bbedceb..c674bf4 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -1,5 +1,5 @@ from functools import cached_property, partial -from typing import Dict, Literal, Optional, Tuple +from typing import Literal from urllib.parse import urlparse import httpx @@ -334,7 +334,7 @@ class Identity(StatorModel): ### Actor/Webfinger fetching ### @classmethod - async def fetch_webfinger(cls, handle: str) -> Tuple[Optional[str], Optional[str]]: + async def fetch_webfinger(cls, handle: str) -> tuple[str | None, str | None]: """ Given a username@domain handle, returns a tuple of (actor uri, canonical handle) or None, None if it does not resolve. @@ -458,7 +458,7 @@ class Identity(StatorModel): raise ValueError( f"Could not save Identity at end of actor fetch: {e}" ) - self.pk: Optional[int] = other_row.pk + self.pk: int | None = other_row.pk await sync_to_async(self.save)() return True @@ -468,7 +468,7 @@ class Identity(StatorModel): self, method: Literal["get", "post"], uri: str, - body: Optional[Dict] = None, + body: dict | None = None, ): """ Performs a signed request on behalf of the System Actor. diff --git a/users/models/system_actor.py b/users/models/system_actor.py index c337d78..c4319b9 100644 --- a/users/models/system_actor.py +++ b/users/models/system_actor.py @@ -1,4 +1,4 @@ -from typing import Dict, Literal, Optional +from typing import Literal from django.conf import settings @@ -57,7 +57,7 @@ class SystemActor: self, method: Literal["get", "post"], uri: str, - body: Optional[Dict] = None, + body: dict | None = None, ): """ Performs a signed request on behalf of the System Actor. diff --git a/users/models/user.py b/users/models/user.py index 08a703e..e0cac9d 100644 --- a/users/models/user.py +++ b/users/models/user.py @@ -1,5 +1,3 @@ -from typing import List - from django.contrib.auth.models import AbstractBaseUser, BaseUserManager from django.db import models @@ -42,7 +40,7 @@ class User(AbstractBaseUser): USERNAME_FIELD = "email" EMAIL_FIELD = "email" - REQUIRED_FIELDS: List[str] = [] + REQUIRED_FIELDS: list[str] = [] objects = UserManager() diff --git a/users/views/settings/interface.py b/users/views/settings/interface.py index fe8e1e9..5c4f229 100644 --- a/users/views/settings/interface.py +++ b/users/views/settings/interface.py @@ -1,5 +1,5 @@ from functools import partial -from typing import ClassVar, Dict, List +from typing import ClassVar from django import forms from django.core.files import File @@ -21,8 +21,8 @@ class SettingsPage(FormView): options_class = Config.IdentityOptions template_name = "settings/settings.html" section: ClassVar[str] - options: Dict[str, Dict[str, str]] - layout: Dict[str, List[str]] + options: dict[str, dict[str, str]] + layout: dict[str, list[str]] def get_form_class(self): # Create the fields dict from the config object |