CORD-3088 Prevent misleading error messages when updating deleted objs
Change-Id: I71e2844badea2977a34f30af1422a0331570efc7
diff --git a/xos/coreapi/apihelper.py b/xos/coreapi/apihelper.py
index afe50b9..ae2102c 100644
--- a/xos/coreapi/apihelper.py
+++ b/xos/coreapi/apihelper.py
@@ -517,7 +517,9 @@
obj.save(**save_kwargs)
- self.handle_m2m(obj, message, m2m_update_fields)
+ # CORD-3088: Do not call handle_m2m for deleted objects
+ if not obj.deleted:
+ self.handle_m2m(obj, message, m2m_update_fields)
return self.objToProto(obj)
except: