Skip to content

Commit

Permalink
#116 typing issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ephes committed Dec 31, 2023
1 parent 1964ee3 commit 5380a2d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cast/views/gallery.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Optional
from typing import Any, Optional

from django import forms
from django.http import HttpResponse
Expand All @@ -11,8 +11,8 @@


class CommaSeparatedIntegerField(forms.Field):
def to_python(self, value: str) -> list[int]:
if not value:
def to_python(self, value: Any | None) -> list[int]: # Any | None from super -> do not override
if value is None or not value.strip():
return []
return [int(item.strip()) for item in value.split(",")]

Expand Down

0 comments on commit 5380a2d

Please sign in to comment.