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

Method update

backend/api/serializers/model_serializers.py:1435–1448  ·  view source on GitHub ↗
(self, instance, validated_data)

Source from the content-addressed store, hash-verified

1433 return data
1434
1435 def update(self, instance, validated_data):
1436 if instance.payment_status == Invoice.PaymentStatus.PAID:
1437 raise serializers.ValidationError(
1438 "Cannot update a paid invoice. Please create a credit note instead."
1439 )
1440 instance.payment_status = validated_data.get(
1441 "payment_status", instance.payment_status
1442 )
1443 instance.save()
1444 if instance.payment_status == Invoice.PaymentStatus.PAID:
1445 kafka_producer.produce_invoice_pay_in_full(
1446 invoice=instance, payment_date=now_utc(), source="lotus_out_of_band"
1447 )
1448 return instance
1449
1450
1451class InitialExternalPlanLinkSerializer(

Callers

nothing calls this directly

Calls 4

now_utcFunction · 0.90
getMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected