优化列表分页和分支记录,确保更好的数据管理。优秀!
This commit is contained in:
parent
c42a262f41
commit
5802b36f46
@ -49,6 +49,7 @@ class ProjectHistoryAdmin(admin.ModelAdmin):
|
|||||||
|
|
||||||
list_display = ["project", "mr_url", "source_branch", "target_branch", "mr_title"]
|
list_display = ["project", "mr_url", "source_branch", "target_branch", "mr_title"]
|
||||||
list_filter = ["project"]
|
list_filter = ["project"]
|
||||||
|
list_per_page = 10
|
||||||
|
|
||||||
def save_model(self, request, obj, form, change):
|
def save_model(self, request, obj, form, change):
|
||||||
obj.create_by = request.user.username
|
obj.create_by = request.user.username
|
||||||
|
|||||||
@ -134,6 +134,7 @@ class GitLabProvider(GitProvider):
|
|||||||
:param project_id:
|
:param project_id:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
if request_data.get('object_attributes', {}).get("source_branch") and request_data.get('object_attributes', {}).get("target_branch"):
|
||||||
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