Bugfixing

This commit is contained in:
Michal Kváček
2024-02-28 09:41:46 +01:00
parent 1f8b338297
commit c0ae73440d
5 changed files with 9 additions and 8 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ RUN apk update && \
apk add --no-cache tzdata mariadb-client mariadb-dev && \
pip install --upgrade pip
# protoze xfs uzivatel ma id=33
# protoze xfs uzivatel ma id=33
RUN deluser xfs
# uzivatel www-data v alpine neexistuje
+1 -1
View File
@@ -17,7 +17,7 @@ def setup_graphql_endpoint(app: FastAPI, access_security: JwtAccessBearerCookie)
@debug_router.get("/graphql/autologin")
async def autologin():
access_token = access_security.create_access_token(subject={"id": 7, "name": "Franta Vomacka"})
access_token = access_security.create_access_token(subject={"id": 6, "name": "Franta Vomacka"})
response = RedirectResponse(url="/graphql")
access_security.set_access_cookie(response, access_token, expires_delta=timedelta(days=14))
-1
View File
@@ -29,7 +29,6 @@ class GPXParser:
sampled_data = defaultdict(list)
for time, item in indexed_data.items():
key = self.get_timestamp_key(time)
print("item", time, key, item)
sampled_data[key].append(item)
return sampled_data
-2
View File
@@ -52,8 +52,6 @@ class EventQueries:
if username:
filter_params['username'] = username
print("FILTR", filter_params)
return await EventQueryResolver().get_one(
public=public,
user_id=info.context.user_id,
+6 -2
View File
@@ -204,9 +204,13 @@ class User:
@strawberry_sqlalchemy_type(models.Event)
class Event:
async def load_flights(root, info):
async def load_flights(root, info, only_public: Optional[bool] = False):
is_user_logged_in = bool(info.context.user_id)
dataloader = flights_by_event_dataloader if is_user_logged_in else public_flights_by_event_dataloader
if not is_user_logged_in or only_public:
dataloader = public_flights_by_event_dataloader
else:
dataloader = flights_by_event_dataloader
# dataloader = flights_by_event_dataloader if is_user_logged_in else public_flights_by_event_dataloader
return await dataloader.load(root.id)
flights: List[Flight] = strawberry.field(resolver=load_flights)