Exemple #1
0
def delete_all_students():
    if 'username' not in session or session['username'] is None:
        return jsonify(status=400, result="Not Logged In")
    if Account.objects.get(username=session['username']).type != "Admin":
        return jsonify(status=400, result="Unauthorized Access")
    accounts = Account.objects(type='Student')
    for account in accounts:
        account.delete()
    return jsonify(status=200, result="OK")
Exemple #2
0
def delete_student_data():
    Account.objects(type="Student").delete()