Skip to content

Commit

Permalink
Add back finding original id of application from amendments chain
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincarrogan committed Aug 28, 2024
1 parent 0794d1c commit 5170991
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions api/data_workspace/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
)


# def get_original_application(obj):
# if not obj.amendment_of:
# return obj
# return get_original_application(obj.amendment_of)
def get_original_application(obj):
if not obj.amendment_of:
return obj
return get_original_application(obj.amendment_of)


class LicenceStatusSerializer(serializers.Serializer):
Expand All @@ -30,10 +30,15 @@ class LicenceDecisionTypeSerializer(serializers.Serializer):


class SIELApplicationSerializer(serializers.ModelSerializer):
id = serializers.SerializerMethodField()

class Meta:
model = StandardApplication
fields = ("id", "status")

def get_id(self, application):
return get_original_application(application).pk


def decision_type_checker(decision_type):
def _decision_type_check(func):
Expand Down

0 comments on commit 5170991

Please sign in to comment.