website icon indicating copy to clipboard operation
website copied to clipboard

TypeError: 'type' object is not subscriptable in files/models.py

Open williamdes opened this issue 1 year ago • 2 comments

   File "/home/runner/work/website/website/files/models.py", line 417, in <module>
    class Theme(models.Model):
  File "/home/runner/work/website/website/files/models.py", line 474, in Theme
    def supported_versions_list(self) -> list[str]:
TypeError: 'type' object is not subscriptable

I have no idea on how to fix this after a simple code check

williamdes avatar Jan 21 '25 21:01 williamdes

supported_versions_list comes from my PR! The error is because list[str] only works from Python 3.9+.

Either I change this to List[str] with from typing import List or the time has come to upgrade the website to Python 3.9+ 🤔

robinheidrich avatar Jan 27 '25 04:01 robinheidrich

or the time has come to upgrade the website to Python 3.9+ 🤔

Let's upgrade ! Can you handle this in a new PR please ?

williamdes avatar Jan 27 '25 12:01 williamdes