Skip to content

Commit 99a843a

Browse files
authored
Ensure existing service (#84)
1 parent bf38edc commit 99a843a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from typing import List, Dict
21
from fastapi import FastAPI, responses, status
32
from fastapi.encoders import jsonable_encoder
43
from pydantic import BaseModel
@@ -102,4 +101,5 @@ def update_versions_to_newest() -> responses.PlainTextResponse:
102101
general.remove_and_refresh_session(session_token)
103102
return responses.PlainTextResponse(status_code=status.HTTP_200_OK)
104103

105-
session.start_session_cleanup_thread()
104+
105+
session.start_session_cleanup_thread()

util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from typing import Any, List, Dict, Union
44

55
from submodules.model.business_objects import app_version, general
6+
from submodules.model.enums import try_parse_enum_value
67
from service_overview import Service, check_db_uptodate, get_services_info
78
import git
89
from upgrade_logic import base_logic
@@ -91,7 +92,7 @@ def check_has_newer_version() -> bool:
9192
lookup_dict = get_services_info(True)
9293
diff_version = False
9394
for db_entry in current_version:
94-
x = Service[db_entry.service]
95+
x = try_parse_enum_value(db_entry.service, Service, False)
9596
if x in lookup_dict:
9697
link = lookup_dict[x]["link"]
9798
remote_version = __last_tag(link)
@@ -123,7 +124,7 @@ def __last_tag(repo_link: str) -> Any:
123124
if tag[0] == "v":
124125
return tag[1:]
125126
return tag
126-
except Exception as e:
127+
except Exception:
127128
return "0.0.0"
128129

129130

0 commit comments

Comments
 (0)