Skip to content

Commit

Permalink
do not exceed the 80 character limit
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Jan 7, 2025
1 parent e6d2e09 commit 81059ba
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion config/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
INSTALLED_APPS += ["debug_toolbar", "extra_checks"]
MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]

TEMPLATES[0]["OPTIONS"]["string_if_invalid"] = "INVALID EXPRESSION: %s" # type: ignore[index]
TEMPLATES[0]["OPTIONS"]["string_if_invalid"] = ( # type: ignore[index]
"INVALID EXPRESSION: %s"
)

# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#configure-internal-ips
INTERNAL_IPS = [
Expand Down
4 changes: 3 additions & 1 deletion socnet/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

# https://docs.allauth.org/en/latest/common/admin.html#admin
admin.autodiscover()
admin.site.login = secure_admin_login(admin.site.login) # type: ignore[method-assign]
admin.site.login = ( # type: ignore[method-assign]
secure_admin_login(admin.site.login)
)


@admin.register(User)
Expand Down
4 changes: 3 additions & 1 deletion socnet/users/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class Meta(auth_forms.UserChangeForm.Meta): # type: ignore[name-defined]


class UserAdminCreationForm(auth_forms.BaseUserCreationForm[User]):
class Meta(auth_forms.BaseUserCreationForm.Meta): # type: ignore[name-defined]
class Meta(
auth_forms.BaseUserCreationForm.Meta # type: ignore[name-defined]
):
model = User
fields = ("display_name", "email", "username")

Expand Down
2 changes: 1 addition & 1 deletion socnet/users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from datetime import date


def image_upload_to(instance: User, filename: str) -> str: # noqa: ARG001
def image_upload_to(_instance: User, _filename: str) -> str:
return f"{uuid4().hex}.webp"


Expand Down
5 changes: 1 addition & 4 deletions socnet/users/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@


def forbid_self_subscription(
instance: User,
action: str,
pk_set: set[int],
**kwargs: Any, # noqa: ARG001
instance: User, action: str, pk_set: set[int], **_kwargs: Any
) -> None:
if action == "pre_add" and instance.pk in pk_set:
msg = _("You can't subscribe to yourself.")
Expand Down

0 comments on commit 81059ba

Please sign in to comment.