Skip to content

Commit 96b0469

Browse files
committed
Automatically move committed draft patches to the open commitfest
1 parent f6c61e7 commit 96b0469

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pgcommitfest/commitfest/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ def next_draft_cf(start_date):
269269
def get_in_progress(cls):
270270
return cls.objects.filter(status=CommitFest.STATUS_INPROGRESS).first()
271271

272+
@classmethod
273+
def get_open_regular(cls):
274+
return cls.objects.filter(status=CommitFest.STATUS_OPEN, draft=False).first()
275+
272276
def __str__(self):
273277
return self.name
274278

pgcommitfest/commitfest/views.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,7 +1043,7 @@ def close(request, patchid, status):
10431043
)
10441044

10451045
if status == "committed":
1046-
if poc.is_open:
1046+
if poc.commitfest.is_open:
10471047
# Needs to be done before the next if condition, so the committer
10481048
# that's set there is set on the correct poc.
10491049
in_progress_cf = CommitFest.get_in_progress()
@@ -1054,6 +1054,13 @@ def close(request, patchid, status):
10541054
request.user,
10551055
allow_move_to_in_progress=True,
10561056
)
1057+
elif poc.commitfest.draft:
1058+
open_cf = CommitFest.get_open_regular()
1059+
poc = patch.move(
1060+
poc.commitfest,
1061+
open_cf,
1062+
request.user,
1063+
)
10571064

10581065
committer = get_object_or_404(Committer, user__username=request.GET["c"])
10591066
if committer != poc.patch.committer:

0 commit comments

Comments
 (0)