Skip to content

Resolved [Issue #25] Ease in creating commitfest #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
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
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