Skip to content

Commit f0fb426

Browse files
committed
Allow to override POSTGRES_HOST
1 parent a7f6b80 commit f0fb426

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

django/apps/aggregated/management/commands/update_aggregated_data.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@
7575

7676
TASK_GROUP_METADATA_QUERY = f"""
7777
SELECT
78-
P.project_id,
78+
G.project_id,
7979
G.group_id,
80-
CASE
81-
-- Hide area for Footprint
82-
WHEN P.project_type = {Project.Type.FOOTPRINT.value} THEN 0
83-
ELSE G.total_area
80+
(
81+
CASE
82+
-- Hide area for Footprint
83+
WHEN P.project_type = {Project.Type.FOOTPRINT.value} THEN 0
84+
ELSE G.total_area
85+
END
8486
) as total_task_group_area,
8587
G.time_spent_max_allowed
8688
FROM groups G

docker-compose.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ x-django: &base_django
3030
DJANGO_DB_NAME: '${POSTGRES_DB}'
3131
DJANGO_DB_USER: '${POSTGRES_USER}'
3232
DJANGO_DB_PWD: '${POSTGRES_PASSWORD}'
33-
DJANGO_DB_HOST: 'postgres'
33+
DJANGO_DB_HOST: '${POSTGRES_HOST:-postgres}'
3434
DJANGO_DB_PORT: 5432
3535
DJANGO_STATIC_ROOT: '/assets/static/'
3636
DJANGO_MEDIA_ROOT: '/assets/media/'
@@ -62,7 +62,7 @@ x-mapswipe-workers: &base_mapswipe_workers
6262
POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}'
6363
POSTGRES_USER: '${POSTGRES_USER}'
6464
POSTGRES_DB: '${POSTGRES_DB}'
65-
POSTGRES_HOST: 'postgres'
65+
POSTGRES_HOST: '${POSTGRES_HOST:-postgres}'
6666
POSTGRES_PORT: 5432
6767
PGDATA: '/var/lib/postgresql/mapswipe'
6868
IMAGE_BING_API_KEY: '${IMAGE_BING_API_KEY}'

0 commit comments

Comments
 (0)