避免重复写入pr历史数据
This commit is contained in:
parent
b556dc943e
commit
451a6d8b42
@ -143,6 +143,7 @@ class GitLabProvider(GitProvider):
|
|||||||
if request_data.get('object_attributes', {}).get(
|
if request_data.get('object_attributes', {}).get(
|
||||||
"source_branch"
|
"source_branch"
|
||||||
) and request_data.get('object_attributes', {}).get("target_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(
|
models.ProjectHistory.objects.create(
|
||||||
project_id=project_id,
|
project_id=project_id,
|
||||||
project_url=request_data.get("project", {}).get("web_url"),
|
project_url=request_data.get("project", {}).get("web_url"),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user