Sfoglia il codice sorgente

Delete 'app/admin.py'

Tatiana Castro 6 anni fa
parent
commit
b2fb37a79c
1 ha cambiato i file con 0 aggiunte e 32 eliminazioni
  1. 0
    32
      app/admin.py

+ 0
- 32
app/admin.py Vedi File

@@ -1,32 +0,0 @@
1
-from flask import (
2
-    Blueprint, flash, g, redirect, render_template, request, url_for
3
-)
4
-from werkzeug.exceptions import abort
5
-
6
-from app.db import get_db
7
-
8
-bp = Blueprint('admin', __name__)
9
-
10
-@bp.route('/admin', methods=('GET', 'POST'))
11
-def admin():
12
-    if request.method == 'POST':
13
-        eName = request.form['eName']
14
-        office = request.form['oficina']
15
-        last_turn = request.form['turno']
16
-
17
-        db = get_db()
18
-        station_query_res = db.execute(
19
-            'SELECT s_id FROM station WHERE nombre_empleado=?',
20
-            (station_name,)
21
-        ).fetchone()
22
-        if station_query_res is not None:
23
-            station_id = station_query_res[0]
24
-        db.execute(
25
-            'INSERT INTO station (nombre_empleado, oficina, last_turn)'
26
-            ' VALUES (?, ?, ?)',
27
-            (eName, office, 0)
28
-        )
29
-        db.commit()
30
-        return redirect(url_for('admin'))
31
-
32
-    return render_template('admin.html')