Skip to content
Snippets Groups Projects
Commit fb2b7142 authored by Stephanie Freitag's avatar Stephanie Freitag
Browse files

HOLI-11291: mark sdgs as deprecated

parent 5973cbc5
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,10 @@ class UpdateAuthenticatedUserInput:
strawberry.argument(description="Deprecated since 1.52. Use interests_v2 instead."),
] = strawberry.UNSET
interests_v2: Optional[List[str]] = strawberry.UNSET
sdgs: Optional[List[Optional[uuid.UUID]]] = strawberry.UNSET
sdgs: Annotated[
Optional[List[Optional[uuid.UUID]]],
strawberry.argument(description="Deprecated since 1.53."),
] = strawberry.UNSET
skills: Annotated[
Optional[List[Optional[uuid.UUID]]],
strawberry.argument(description="Deprecated since 1.52. Use skills_v2 instead."),
......@@ -112,7 +115,7 @@ class User:
def interests_v2(self) -> List[Optional[str]]:
return self.profile.interests_v2
@strawberry_django.field(select_related=["profile__sdgs"])
@strawberry_django.field(select_related=["profile__sdgs"], deprecation_reason="Deprecated since 1.53.")
def sdgs(self) -> List[Optional[SDG]]:
return self.profile.sdgs.all().order_by("number")
......
......@@ -54,7 +54,10 @@ class ValidateSpaceInput:
] = strawberry.UNSET
topics_v2: Optional[List[str]] = strawberry.UNSET
cover: Optional[Upload] = strawberry.UNSET
sdgs: Optional[List[Optional[uuid.UUID]]] = strawberry.UNSET
sdgs: Annotated[
Optional[List[Optional[uuid.UUID]]],
strawberry.argument(description="Deprecated since 1.53."),
] = strawberry.UNSET
location: Optional[str] = strawberry.UNSET
......@@ -174,7 +177,10 @@ class UpdateSpaceInput:
topics_v2: Optional[List[str]] = strawberry.UNSET
cover: Optional[Upload] = strawberry.UNSET
avatar: Optional[Upload] = strawberry.UNSET
sdgs: Optional[List[Optional[uuid.UUID]]] = strawberry.UNSET
sdgs: Annotated[
Optional[List[Optional[uuid.UUID]]],
strawberry.argument(description="Deprecated since 1.53."),
] = strawberry.UNSET
location: Optional[str] = strawberry.UNSET
geolocation: Optional[GeolocationPointInput] = strawberry.UNSET
contact_description: Optional[str] = strawberry.UNSET
......@@ -285,7 +291,9 @@ class Space:
deprecation_reason="Deprecated since version 1.52, use topics_v2 instead.", default=None
)
topics_v2: List[str]
sdgs: List[Optional[SDG]]
sdgs: List[Optional[SDG]] = strawberry_django.field(
deprecation_reason="Deprecated since version 1.53.", default=None
)
contact_description: Optional[str]
contact_email: Optional[str]
contact_phone: Optional[str]
......
......@@ -19,7 +19,7 @@ class Query:
def topics(self, offset: int = 0, limit: int = 50) -> Paged[Topic]:
return Paged.of(TopicModel.objects.all().order_by("title"), offset, limit)
@strawberry_django.field()
@strawberry_django.field(deprecation_reason="Deprecated since 1.53.")
def sdgs(self, offset: int = 0, limit: int = 50) -> Paged[SDG]:
return Paged.of(SDG_MODEL.objects.all().order_by("number"), offset, limit)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment