mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-07-12 07:42:53 +02:00
fix: partial updates broken due to validation
This commit is contained in:
@@ -73,6 +73,7 @@ class TransactionSerializer(serializers.ModelSerializer):
|
|||||||
]
|
]
|
||||||
|
|
||||||
def validate(self, data):
|
def validate(self, data):
|
||||||
|
if not self.partial:
|
||||||
if "date" in data and "reference_date" not in data:
|
if "date" in data and "reference_date" not in data:
|
||||||
data["reference_date"] = data["date"].replace(day=1)
|
data["reference_date"] = data["date"].replace(day=1)
|
||||||
elif "reference_date" in data:
|
elif "reference_date" in data:
|
||||||
|
|||||||
Reference in New Issue
Block a user