示例#1
0
def delete_reminder(remind_id):
	'''GUI: delete a secure message from the DB'''
	record = Reminder.query.get(remind_id)
	if record == None:
		flash('Could not find reminder in database.')
		return redirect(url_for('serve_vm_admin'))
	else:
		db_session.delete(record)
		db_session.commit()
		return redirect(url_for('serve_vm_admin'))				
示例#2
0
def delete_reminder(remind_id):
    '''GUI: delete a secure message from the DB'''
    record = Reminder.query.get(remind_id)
    if record == None:
        flash('Could not find reminder in database.')
        return redirect(url_for('serve_vm_admin'))
    else:
        db_session.delete(record)
        db_session.commit()
        return redirect(url_for('serve_vm_admin'))
示例#3
0
def delete_intent(intent_id):
	'''GUI: delete an intent from the DB'''
	record = Intent.query.get(intent_id)
	if record == None:
		flash('Could not find route in database.')
		return redirect(url_for('serve_intent_admin'))
	else:
		flash('Route removed.')
		db_session.delete(record)
		db_session.commit()
		return redirect(url_for('serve_intent_admin'))				
示例#4
0
def delete_assignment(assign_id):
	'''GUI: delete an assignment from the DB'''
	record = Assignment.query.get(assign_id)
	if record == None:
		flash('Could not find assignment in database.')
		return redirect(url_for('serve_assignment_admin'))
	else:
		flash('Assignment removed.')
		db_session.delete(record)
		db_session.commit()
		return redirect(url_for('serve_assignment_admin'))				
示例#5
0
def delete_intent(intent_id):
    '''GUI: delete an intent from the DB'''
    record = Intent.query.get(intent_id)
    if record == None:
        flash('Could not find route in database.')
        return redirect(url_for('serve_intent_admin'))
    else:
        flash('Route removed.')
        db_session.delete(record)
        db_session.commit()
        return redirect(url_for('serve_intent_admin'))
示例#6
0
def delete_assignment(assign_id):
    '''GUI: delete an assignment from the DB'''
    record = Assignment.query.get(assign_id)
    if record == None:
        flash('Could not find assignment in database.')
        return redirect(url_for('serve_assignment_admin'))
    else:
        flash('Assignment removed.')
        db_session.delete(record)
        db_session.commit()
        return redirect(url_for('serve_assignment_admin'))
示例#7
0
def delete_vm(record_id):
	'''GUI: delete a voicemail from the DB'''
	if app.debug == False:
		return "Delete not allowed in production.", 403
	record = Voicemail.query.get(record_id)
	if record == None:
		flash('Could not find VM record in database.')
		return redirect(url_for('serve_vm_admin'))
	else:
		flash('Voicemail removed.')
		db_session.delete(record)
		db_session.commit()
		return redirect(url_for('serve_vm_admin'))				
示例#8
0
def delete_call(call_id):
	'''GUI: delete a call record from the DB'''
	if app.debug == False:
		return "Delete not allowed in production.", 403
	record = Call.query.get(call_id)
	if record == None:
		flash('Could not find call record in database.')
		return redirect(url_for('serve_call_admin'))
	else:
		flash('Call record removed.')
		db_session.delete(record)
		db_session.commit()
		return redirect(url_for('serve_call_admin'))				
示例#9
0
def delete_vm(record_id):
    '''GUI: delete a voicemail from the DB'''
    if app.debug == False:
        return "Delete not allowed in production.", 403
    record = Voicemail.query.get(record_id)
    if record == None:
        flash('Could not find VM record in database.')
        return redirect(url_for('serve_vm_admin'))
    else:
        flash('Voicemail removed.')
        db_session.delete(record)
        db_session.commit()
        return redirect(url_for('serve_vm_admin'))
示例#10
0
def delete_call(call_id):
    '''GUI: delete a call record from the DB'''
    if app.debug == False:
        return "Delete not allowed in production.", 403
    record = Call.query.get(call_id)
    if record == None:
        flash('Could not find call record in database.')
        return redirect(url_for('serve_call_admin'))
    else:
        flash('Call record removed.')
        db_session.delete(record)
        db_session.commit()
        return redirect(url_for('serve_call_admin'))
示例#11
0
Requires:
    twilio_AccountSID, twilio_AuthToken
"""

## assignment autoclear on tuesday nights

# get day of week (0 is Monday and 6 is Sunday)
day_of_week = datetime.now(pytz.timezone('US/Eastern')).weekday()

if day_of_week == 1: # if it's a Tuesday (and this runs at 11:58 PM)
	assignments = Assignment.query.order_by(Assignment.id.desc()).all()
	# print "Found %d assignments to delete." % len(assignments)
	try:
		for a in assignments:
			db_session.delete(a)
		db_session.commit()
		# print "Deleted %d assignments." % len(assignments)
	except BaseException as err:
		print "ERROR: couldn't delete assignments."
		print err
##

record_sids = []
with open("/var/wsgiapps/ehhapp_twilio/download_log.txt", "r") as fp:
	for line in fp:
		record_sids.append(line.strip())

client = TwilioRestClient(twilio_AccountSID, twilio_AuthToken)

# step 1 - delete recordings (more of a catch-all)