| |
@@ -27,8 +27,8 @@
|
| |
import json
|
| |
import itertools
|
| |
|
| |
- from blockerbugs import app, __version__
|
| |
- from blockerbugs.util import bz_interface, pagure_bot, misc
|
| |
+ from blockerbugs import app, db, __version__
|
| |
+ from blockerbugs.util import bz_interface, pagure_bot, misc, discussion_sync, bug_sync
|
| |
from blockerbugs.models.bug import Bug
|
| |
from blockerbugs.models.milestone import Milestone
|
| |
from blockerbugs.models.update import Update
|
| |
@@ -443,6 +443,19 @@
|
| |
|
| |
return bz_interface.create_bugzilla()
|
| |
|
| |
+ def bugzilla_sync_proposal(bugid, milestone, blocker, fe):
|
| |
+ # Fetch the proposed stuff into the database right away
|
| |
+ sync = bug_sync.BugSync(db)
|
| |
+ trackers_str = []
|
| |
+ if blocker: trackers_str.append("Blocker")
|
| |
+ if fe: trackers_str.append("FreezeException")
|
| |
+ sync.fetch_single_bug(milestone, bugid, trackers_str)
|
| |
+
|
| |
+ # Create a discussion ticket
|
| |
+ discussion_sync.create_discussions_links(milestone, [misc.bug_from_db(bugid, milestone)])
|
| |
+
|
| |
+ # Cross-comment the voting ticket link to the bugzilla
|
| |
+ bz_interface.comment_bz(misc.bug_from_db(bugid, milestone))
|
| |
|
| |
@main.route('/propose_bug', methods=['GET', 'POST'])
|
| |
@fas_login_required
|
| |
@@ -500,6 +513,7 @@
|
| |
user, bugid, proposal.get_tracker_type(), selected_milestone.name))
|
| |
try:
|
| |
proposal.propose_bugs(user, selected_milestone.name, bugform.justification.data)
|
| |
+ bugzilla_sync_proposal(bugid, selected_milestone, bool(bugform.blocker.data), bool(bugform.freeze_exception.data))
|
| |
return render_template('thanks.html', bugid=bugid,
|
| |
isblocker=bugform.blocker.data,
|
| |
isfe=bugform.freeze_exception.data,
|
| |
Fixes #148
Apart from that, it causes the proposed bugs to appear immediately in the blockerbugs app, without needing to wait up to 30 minutes for the next sync. Slightly increases time that it takes to process proposals.