File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed
src/pypsa_app/backend/api/routes Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ services:
8585 [
8686 " celery" ,
8787 " -A" ,
88- " pypsa_app.backend.celery_app " ,
88+ " pypsa_app.backend.task_queue.task_app " ,
8989 " worker" ,
9090 " --loglevel=${CELERY_LOGLEVEL:-info}" ,
9191 " --concurrency=${CELERY_CONCURRENCY:-2}" ,
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ services:
6868 [
6969 " celery" ,
7070 " -A" ,
71- " pypsa_app.backend.celery_app " ,
71+ " pypsa_app.backend.task_queue.task_app " ,
7272 " worker" ,
7373 " --loglevel=${CELERY_LOGLEVEL:-info}" ,
7474 " --concurrency=${CELERY_CONCURRENCY:-4}" ,
Original file line number Diff line number Diff line change 22from pathlib import Path
33
44from fastapi import APIRouter , Depends , HTTPException
5+ from sqlalchemy import or_
56from sqlalchemy .orm import Session
67
78from pypsa_app .backend .api .deps import get_current_user , get_db , get_network_or_404
@@ -37,14 +38,12 @@ def list_networks(
3738 query = db .query (Network )
3839
3940 # When auth is enabled, filter by ownership or public networks
40- if settings .enable_auth and user is not None :
41- from sqlalchemy import or_
42-
41+ if settings .enable_auth :
4342 query = query .filter (
4443 or_ (
4544 Network .user_id == user .id , # User's own networks
46- Network .is_public is True ,
47- Network .user_id is None , # No owner
45+ Network .is_public == True , # noqa: E712
46+ Network .user_id == None , # noqa: E711 # Legacy networks without owner
4847 )
4948 )
5049
You can’t perform that action at this time.
0 commit comments