Skip to content

Commit 0e39bf7

Browse files
committed
fix(export): convert progress to float in projects.csv
1 parent be521b1 commit 0e39bf7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/project/graphql/types/types.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,17 @@ class ProjectType(UserResourceTypeMixin, ProjectExportAssetTypeMixin, FirebasePu
176176
aoi_geometry: GeometryType | None
177177

178178
progress_status: strawberry.auto
179-
progress: strawberry.auto
180179
number_of_contributor_users: strawberry.auto
181180
number_of_results: strawberry.auto
182181
number_of_results_for_progress: strawberry.auto
183182
last_contribution_date: strawberry.auto
184183

184+
@strawberry_django.field(
185+
description=str(Project._meta.get_field("progress").help_text), # type: ignore[reportAttributeAccessIssue]
186+
)
187+
def progress(self, project: strawberry.Parent[Project]) -> float:
188+
return project.progress / 100
189+
185190
@strawberry_django.field(
186191
description="No. of unique contributors in this project",
187192
)

schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1802,7 +1802,7 @@ type ProjectType implements UserResourceTypeMixin & ProjectExportAssetTypeMixin
18021802
processingStatus: ProjectProcessingStatusEnum
18031803

18041804
"""Percentage of the required contribution that has been completed"""
1805-
progress: Int!
1805+
progress: Float!
18061806
progressStatus: ProjectProgressStatusEnum!
18071807

18081808
"""Provide project instruction"""

0 commit comments

Comments
 (0)