Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
silviogutierrez committed Feb 22, 2024
1 parent b27b33b commit c997ddc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion development/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Django==4.0.1
psycopg2-binary==2.9.3
simplejson==3.16.0
django-stubs==1.9.0
django-stubs==4.2.7
mypy==1.8.0
black==22.3.0
isort==5.10.1
Expand Down
11 changes: 8 additions & 3 deletions development/server/example/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,14 @@ class Meta:
fields = ["choice_text", "votes"]


ChoiceFormSet = forms.modelformset_factory(
model=models.Choice, form=Choice, extra=0, min_num=2, validate_min=True
)
class ChoiceFormSet(forms.BaseModelFormSet[models.Choice, Choice]):
extra = 0
min_num = 2
max_num = 0
validate_min = True
form = Choice
renderer = None
model = models.Choice


class Comment(forms.ModelForm[models.Comment]):
Expand Down
2 changes: 1 addition & 1 deletion website/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Django==4.0.1
psycopg2-binary==2.9.3
simplejson==3.16.0
django-stubs==1.9.0
django-stubs==4.2.7
mypy==1.8.0
black==22.3.0
isort==5.10.1
Expand Down
4 changes: 2 additions & 2 deletions website/server/documentation/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Optional, cast

import requests
from django.conf import settings
Expand Down Expand Up @@ -41,7 +41,7 @@ def get_latest_tag() -> str:
def home_page(request: HttpRequest) -> HttpResponse:
stars = cache.get_or_set("stars", get_stars)

return templates.HomePage(stars=stars).render(request)
return templates.HomePage(stars=cast(str, stars)).render(request)


def install(request: HttpRequest, *, tag: Optional[str] = None) -> HttpResponse:
Expand Down

0 comments on commit c997ddc

Please sign in to comment.