Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ on:
push:
branches:
- main
<<<<<<< HEAD
- prod
=======
>>>>>>> 96758a1 (Implement github action to deploy to test environment)
Comment on lines +7 to +10
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contains a merge conflict.


jobs:
deployment:
Expand Down
36 changes: 19 additions & 17 deletions pgcommitfest/commitfest/admin.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
from django.contrib import admin

from .models import (
CfbotBranch,
CfbotTask,
CommitFest,
Committer,
MailThread,
MailThreadAttachment,
Patch,
PatchHistory,
PatchOnCommitFest,
TargetVersion,
Topic,
)

from django.utils.timezone import now
from .models import *

class CommitfestAdmin(admin.ModelAdmin):
@admin.action(description="Start selected Commitfest")
def startCommitfest(self,request,queryset):
Comment on lines +5 to +7
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of integrating these in the admin panel I think it would feel more natural to put these buttons next to the admin buttons:

image

The "Start commitfest" button should also do something else important: Change the next "Future" commitfest to "Open", or if no "Future" commitfest exist, create a new "open" commitfest.

for commitfest in queryset:
if commitfest.status == 2:
commitfest.status = 3
commitfest.save()
@admin.action(description="End selected Commitfest")
def endCommitfest(self,request,queryset):
for commitfest in queryset:
if commitfest.status == 3:
commitfest.status = 4
commitfest.enddate = now()
commitfest.save()
actions = [startCommitfest, endCommitfest]

class CommitterAdmin(admin.ModelAdmin):
list_display = ("user", "active")
Expand All @@ -37,9 +40,8 @@ class MailThreadAttachmentAdmin(admin.ModelAdmin):
"mailthread",
)


admin.site.register(Committer, CommitterAdmin)
admin.site.register(CommitFest)
admin.site.register(CommitFest,CommitfestAdmin)
admin.site.register(Topic)
admin.site.register(Patch, PatchAdmin)
admin.site.register(PatchHistory)
Expand Down