From 370a859211739386aa457587a022aae7ca34e605 Mon Sep 17 00:00:00 2001 From: J-E Castagnede Date: Fri, 26 Apr 2024 11:48:38 +0200 Subject: [PATCH] add contributions by station endpoint --- georiviere/portal/serializers/contribution.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/georiviere/portal/serializers/contribution.py b/georiviere/portal/serializers/contribution.py index 02d066a4..50d31b0e 100644 --- a/georiviere/portal/serializers/contribution.py +++ b/georiviere/portal/serializers/contribution.py @@ -187,7 +187,9 @@ class CustomContributionSerializer(serializers.ModelSerializer): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - custom_type = self.context.get("custom_type") + custom_type = self.context.get("custom_type", None) + if not custom_type: + return # add and customize fields from json schema schema = custom_type.get_json_schema_form()