Browse Source

Adds admin_insert blueprint and removes unneeded code from admin_insert

Jose Reyes 5 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,4 +25,8 @@ def create_app(test_config=None):
25 25
     app.register_blueprint(index.bp)
26 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 32
     return app

+ 0
- 7
app/admin_insert.py View File

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