def auto_dial_disable(request): """10/03/19: moved from view.py""" if dsh_django_request.deny_it(request): return views.please_log_in() response = views.page_header('disable auto-dial') dsh_db_config.set('auto_dial_disable', True) disabled = dsh_db_config.get('auto_dial_disable') if not disabled: message = 'views.auto_dial_disable: unexpected error.' response += dsh_utils.red_error_break_msg(message) dsh_django_utils.error_event(message, errorLevel='CRT') response += views.page_footer() return HttpResponse(response) response += spool_wipe_status_message() dsh_django_utils.auto_schedule_delete_all() response += dsh_utils.black_break_msg( 'now <font color=red><b>disabled</b></font>. ' +\ 'wanna <a href="/autodialenable">re-enable</a>?') response += views.page_footer() dsh_agi.report_event('auto-dial disabled.') return HttpResponse(response)
def schedule_del_all(request): if dsh_django_request.deny_it(request): return please_log_in() response = page_header('delete all auto-dialed outgoing calls') output = dsh_django_utils.auto_schedule_delete_all(force=True) response += output response += page_footer() return HttpResponse(response)