Fix random Mypy errors
This commit is contained in:
parent
2ff314ecc8
commit
f45864c786
7 changed files with 7 additions and 19 deletions
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
|
@ -23,6 +23,7 @@
|
||||||
"pydocstyle",
|
"pydocstyle",
|
||||||
"pyright",
|
"pyright",
|
||||||
"pytest",
|
"pytest",
|
||||||
|
"Ravendawn",
|
||||||
"regularuser",
|
"regularuser",
|
||||||
"runserver",
|
"runserver",
|
||||||
"sendgrid",
|
"sendgrid",
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ def profile_view(request: HttpRequest) -> HttpResponse:
|
||||||
Returns:
|
Returns:
|
||||||
HttpResponse: Rendered profile template.
|
HttpResponse: Rendered profile template.
|
||||||
"""
|
"""
|
||||||
subscriptions = NotificationSubscription.objects.filter(user=request.user)
|
subscriptions = NotificationSubscription.objects.filter(user=request.user) # type: ignore[misc]
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"accounts/profile.html",
|
"accounts/profile.html",
|
||||||
|
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import os
|
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from django.core.asgi import get_asgi_application
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from django.core.handlers.asgi import ASGIHandler
|
|
||||||
|
|
||||||
os.environ.setdefault(key="DJANGO_SETTINGS_MODULE", value="config.settings")
|
|
||||||
|
|
||||||
application: ASGIHandler = get_asgi_application()
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from debug_toolbar.toolbar import debug_toolbar_urls # pyright: ignore[reportMissingTypeStubs]
|
from debug_toolbar.toolbar import debug_toolbar_urls # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs]
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from django.urls import include, path
|
from django.urls import include, path
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ class DropCampaignAdmin(admin.ModelAdmin):
|
||||||
list_display = ("id", "name", "game", "owner", "start_at", "end_at", "is_active")
|
list_display = ("id", "name", "game", "owner", "start_at", "end_at", "is_active")
|
||||||
list_filter = ("game", "owner")
|
list_filter = ("game", "owner")
|
||||||
search_fields = ("id", "name", "description")
|
search_fields = ("id", "name", "description")
|
||||||
inlines = [TimeBasedDropInline] # noqa: RUF012
|
inlines = [TimeBasedDropInline]
|
||||||
readonly_fields = ("created_at", "updated_at")
|
readonly_fields = ("created_at", "updated_at")
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -61,7 +61,7 @@ class TimeBasedDropAdmin(admin.ModelAdmin):
|
||||||
)
|
)
|
||||||
list_filter = ("campaign__game", "campaign")
|
list_filter = ("campaign__game", "campaign")
|
||||||
search_fields = ("id", "name")
|
search_fields = ("id", "name")
|
||||||
inlines = [DropBenefitEdgeInline] # noqa: RUF012
|
inlines = [DropBenefitEdgeInline]
|
||||||
|
|
||||||
|
|
||||||
@admin.register(DropBenefit)
|
@admin.register(DropBenefit)
|
||||||
|
|
|
||||||
|
|
@ -6,5 +6,5 @@ from django.apps import AppConfig
|
||||||
class TwitchConfig(AppConfig):
|
class TwitchConfig(AppConfig):
|
||||||
"""AppConfig subclass for the 'twitch' application."""
|
"""AppConfig subclass for the 'twitch' application."""
|
||||||
|
|
||||||
default_auto_field: str = "django.db.models.BigAutoField"
|
default_auto_field = "django.db.models.BigAutoField"
|
||||||
name = "twitch"
|
name = "twitch"
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ class TimeBasedDrop(models.Model):
|
||||||
|
|
||||||
# Foreign keys
|
# Foreign keys
|
||||||
campaign = models.ForeignKey(DropCampaign, on_delete=models.CASCADE, related_name="time_based_drops", db_index=True)
|
campaign = models.ForeignKey(DropCampaign, on_delete=models.CASCADE, related_name="time_based_drops", db_index=True)
|
||||||
benefits = models.ManyToManyField(DropBenefit, through="DropBenefitEdge", related_name="drops")
|
benefits = models.ManyToManyField(DropBenefit, through="DropBenefitEdge", related_name="drops") # type: ignore[var-annotated]
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
indexes: ClassVar[list] = [
|
indexes: ClassVar[list] = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue