1
0

More robust UserInfo

This commit is contained in:
Jon Michael Aanes 2024-10-01 13:23:22 +02:00
parent c98946cacb
commit ce10f41330
3 changed files with 6 additions and 5 deletions

View File

@ -16,7 +16,7 @@ def main():
with tempfile.TemporaryDirectory(prefix='favro_sync_') as tmpdirname: with tempfile.TemporaryDirectory(prefix='favro_sync_') as tmpdirname:
session = requests_cache.CachedSession( session = requests_cache.CachedSession(
tmpdirname + '/http-cache.sqlite', tmpdirname + '/http-cache.sqlite',
expire_after=10, expire_after=300,
) )
client = FavroClient( client = FavroClient(

View File

@ -57,10 +57,10 @@ class UserInfo:
@staticmethod @staticmethod
def from_json(json: dict[str, Any]) -> 'UserInfo': def from_json(json: dict[str, Any]) -> 'UserInfo':
return UserInfo( return UserInfo(
UserId(json['userId']), map_opt(UserId, json.get('userId')),
json['name'], json.get('name'),
json['email'], json.get('email'),
json['organizationRole'], json.get('organizationRole'),
) )

View File

@ -201,6 +201,7 @@ class FavroFuse(fuse.Fuse):
seq_id=card.seq_id.raw_id, seq_id=card.seq_id.raw_id,
), ),
todo_list_completed = card.todo_list_completed, todo_list_completed = card.todo_list_completed,
archived=card.archived,
start_date= card.start_date, start_date= card.start_date,
due_date= card.due_date, due_date= card.due_date,
) )