feat: batchst g_create 默认relation_type

This commit is contained in:
caoqianming 2025-03-28 08:28:58 +08:00
parent 40370b876f
commit 73f0e504c9
1 changed files with 2 additions and 1 deletions

View File

@ -642,7 +642,8 @@ class BatchLog(BaseModel):
raise ParseError("relation_type must be split or merge") raise ParseError("relation_type must be split or merge")
if handover is None and mlog is None: if handover is None and mlog is None:
raise ParseError("handover or mlog must be provided") raise ParseError("handover or mlog must be provided")
return cls.objects.get_or_create(source=source, target=target, relation_type=relation_type, handover=handover, mlog=mlog) return cls.objects.get_or_create(source=source, target=target, handover=handover, mlog=mlog,
defaults={"relation_type": relation_type})
@classmethod @classmethod
def clear(cls, handover=None, mlog=None, mio=None): def clear(cls, handover=None, mlog=None, mio=None):