From 0257441966a0f74024c2d6348abd5cc8531f580a Mon Sep 17 00:00:00 2001 From: alhendrickson <159636032+alhendrickson@users.noreply.github.com.> Date: Wed, 21 Jan 2026 12:28:04 +0000 Subject: [PATCH] fix(medcat-trainer): Remove kwargs from modelpack.save as they error --- medcat-trainer/webapp/api/api/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/medcat-trainer/webapp/api/api/models.py b/medcat-trainer/webapp/api/api/models.py index eee883c31..5669a3e79 100644 --- a/medcat-trainer/webapp/api/api/models.py +++ b/medcat-trainer/webapp/api/api/models.py @@ -137,7 +137,8 @@ def save(self, *args, skip_load=False, **kwargs): else: # For new objects, just update the FK fields without full save # Fixes psycopg.errors.UniqueViolation: duplicate key value violates unique constraint "api_modelpack_pkey" - super().save(*args, update_fields=['concept_db', 'vocab'], **kwargs) + # Note without args or kwargs as these make the error "ValueError("Cannot force both insert and updating in model saving.")" + super().save(update_fields=['concept_db', 'vocab']) def __str__(self): return self.name