Browse Source

Adds admin_insert blueprint and removes unneeded code from admin_insert

Jose Reyes 6 years ago
parent
commit
497337f51c
2 changed files with 4 additions and 7 deletions
  1. 4
    0
      app/__init__.py
  2. 0
    7
      app/admin_insert.py

+ 4
- 0
app/__init__.py View File

25
     app.register_blueprint(index.bp)
25
     app.register_blueprint(index.bp)
26
     app.add_url_rule('/', endpoint='index')
26
     app.add_url_rule('/', endpoint='index')
27
 
27
 
28
+    from . import admin_insert
29
+    app.register_blueprint(admin_insert.bp)
30
+    app.add_url_rule('/admin_insert', endpoint='admin_insert')
31
+
28
     return app
32
     return app

+ 0
- 7
app/admin_insert.py View File

12
     if request.method == 'POST':
12
     if request.method == 'POST':
13
         eName = request.form['eName']
13
         eName = request.form['eName']
14
         office = request.form['oficina']
14
         office = request.form['oficina']
15
-        last_turn = request.form['turno']
16
 
15
 
17
         db = get_db()
16
         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(
17
         db.execute(
25
             'INSERT INTO station (nombre_empleado, oficina, last_turn)'
18
             'INSERT INTO station (nombre_empleado, oficina, last_turn)'
26
             ' VALUES (?, ?, ?)',
19
             ' VALUES (?, ?, ?)',