Fix typing of associations in user model

This commit is contained in:
Charlotte Van Petegem 2022-05-25 10:07:30 +02:00
parent 4d9d43b0f0
commit c04d9bbd44
No known key found for this signature in database
GPG key ID: 019E764B7184435A

View file

@ -1,5 +1,5 @@
"Script for everything User related in the database"
from typing import List
from typing import List, Optional
from models import db
@ -25,7 +25,7 @@ class User(db.Model):
def association_list(self) -> List[str]:
return self.associations.split(",")
def configure(self, username: str, admin: bool, bias: int, associations: List[str] = None) -> None:
def configure(self, username: str, admin: bool, bias: int, associations: Optional[List[str]] = None) -> None:
"""Configure the User"""
if associations is None:
associations = []