Development
This commit is contained in:
parent
5bb382e62f
commit
163b2df247
1 changed files with 5 additions and 4 deletions
|
|
@ -1,8 +1,7 @@
|
|||
from flask import Blueprint, request, redirect, flash, session
|
||||
from auth import require_level
|
||||
from config_utils import (flush_pending_to_queue, get_dashboard_pending,
|
||||
revert_snapshot_to_config, queued_msg,
|
||||
_timing_status_msg)
|
||||
revert_snapshot_to_config, queued_msg)
|
||||
|
||||
bp = Blueprint('action_actions', __name__)
|
||||
|
||||
|
|
@ -20,11 +19,13 @@ def actions_cardpending_save():
|
|||
@bp.route('/action/actions_cardpending_applynow', methods=['POST'])
|
||||
@require_level('administrator')
|
||||
def actions_cardpending_applynow():
|
||||
if not get_dashboard_pending():
|
||||
pending = get_dashboard_pending()
|
||||
if not pending:
|
||||
flash('No pending changes to apply.', 'info')
|
||||
return redirect(_VIEW)
|
||||
flush_pending_to_queue()
|
||||
flash(_timing_status_msg(None, 'Changes queued'), 'success')
|
||||
if any(cmd != 'fix problems' for _, _, cmd, _ in pending):
|
||||
flash('Changes queued.', 'success')
|
||||
return redirect(_VIEW)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue