MCPcopy
hub / github.com/uselotus/lotus / validate

Method validate

backend/api/views.py:2299–2312  ·  view source on GitHub ↗
(self, data)

Source from the content-addressed store, hash-verified

2297 )
2298
2299 def validate(self, data):
2300 data = super().validate(data)
2301 data["metric"] = data.pop("metric_id", None)
2302 data["customer"] = data.pop("customer_id", None)
2303 if data.get("event_name") is not None and data.get("metric") is not None:
2304 raise serializers.ValidationError(
2305 "event_name and metric_id are mutually exclusive. Please only provide one."
2306 )
2307 if data.get("event_name") is None and data.get("metric") is None:
2308 raise serializers.ValidationError(
2309 "You must provide either an event_name or a metric_id."
2310 )
2311
2312 return data
2313
2314
2315class GetCustomerFeatureAccessRequestSerializer(serializers.Serializer):

Callers 6

CreatePlanFunction · 0.45
EditPlanFunction · 0.45
archiveMethod · 0.45
validateMethod · 0.45
getMethod · 0.45
getMethod · 0.45

Calls 1

getMethod · 0.45

Tested by

no test coverage detected