Skip to content

Commit

Permalink
tss-1783: Add set_to_allowed_on to data workspace serializer (#790)
Browse files Browse the repository at this point in the history
* tss-1783: Add set_to_allowed_on to data workspace serializer

* tests

---------

Co-authored-by: abarolo <[email protected]>
  • Loading branch information
abarolo and abarolo authored May 14, 2024
1 parent e3fe2ff commit 83a8445
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/barriers/serializers/data_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class DataWorkspaceSerializer(AssessmentFieldsMixin, BarrierSerializerBase):
reported_by = serializers.SerializerMethodField()
barrier_owner = serializers.SerializerMethodField()
first_published_on = serializers.SerializerMethodField()
set_to_allowed_on = serializers.SerializerMethodField()

class Meta(BarrierSerializerBase.Meta):
fields = (
Expand Down Expand Up @@ -243,6 +244,7 @@ class Meta(BarrierSerializerBase.Meta):
"public_eligibility_summary",
"public_eligibility_postponed",
"first_published_on",
"set_to_allowed_on",
"resolvability_assessments",
"sectors",
"sectors_affected",
Expand Down Expand Up @@ -553,3 +555,7 @@ def get_barrier_owner(self, obj):
def get_first_published_on(self, obj):
if hasattr(obj, "public_barrier"):
return obj.public_barrier.first_published_on

def get_set_to_allowed_on(self, obj):
if hasattr(obj, "public_barrier"):
return obj.public_barrier.set_to_allowed_on

0 comments on commit 83a8445

Please sign in to comment.