避免重复写入pr历史数据

This commit is contained in:
张建平 2025-04-23 15:31:59 +08:00
parent b556dc943e
commit 451a6d8b42

View File

@ -143,6 +143,7 @@ class GitLabProvider(GitProvider):
if request_data.get('object_attributes', {}).get(
"source_branch"
) and request_data.get('object_attributes', {}).get("target_branch"):
if not models.ProjectHistory.objects.filter(project_id=project_id, mr_url=request_data.get('object_attributes', {}).get("url")).exists():
models.ProjectHistory.objects.create(
project_id=project_id,
project_url=request_data.get("project", {}).get("web_url"),