I am getting an error which says as below when I am working with this along with session management. 

```
werkzeug.exceptions.BadRequestKeyError

werkzeug.exceptions.HTTPException.wrap.<locals>.newcls: 400 Bad Request: KeyError: 'Employee_Name'

Traceback (most recent call last)
File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 2309, in __call__
return self.wsgi_app(environ, start_response)

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 2295, in wsgi_app
response = self.handle_exception(e)

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\_compat.py", line 35, in reraise
raise value

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 1815, in full_dispatch_request
rv = self.handle_user_exception(e)

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 1718, in handle_user_exception
reraise(exc_type, exc_value, tb)

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\_compat.py", line 35, in reraise
raise value

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\flask\app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)

File "C:\Users\Lenovo\Desktop\intern\Employee_Management_system-master\app1.py", line 130, in admin_personaldetails
Employee_Name = userDetails['Employee_Name']

File "C:\Users\Lenovo\AppData\Local\Programs\Python\Python36\lib\site-packages\werkzeug\datastructures.py", line 431, in __getitem__
raise exceptions.BadRequestKeyError(key)

werkzeug.exceptions.HTTPException.wrap.<locals>.newcls: 400 Bad Request: KeyError: 'Employee_Name'

```

HTML:

```
       <form action="details" method="POST">
         Employee_Name <input type="text" name="Employee_Name"/> 
         Employee_ID <input type="text" name="Employee_ID"/> 

         <input type="submit" name="SUBMIT" value="SUBMIT"/>     
        </form>

```

Python: 

```
@app.route('/details', methods=['GET', 'POST'])
def admin_personaldetails():
    if request.method == 'POST' or 'GET':
       userDetails = request.form
       if 'Employee_ID' in session:  
          Employee_ID = session['Employee_ID']
       if Employee_ID=='Admin':
          userDetails=request.form
          Employee_Name = userDetails['Employee_Name']
          Employee_ID = userDetails['Employee_ID']
          cur = mysql.connection.cursor()
          cur.execute("INSERT INTO Employee(Employee_Name, Employee_ID)      VALUES(%s, %s)",(Employee_Name, Employee_ID))
          mysql.connection.commit()
          cur.close()
          return render_template('details.html', Details = Details)
      else:
          return "<h1>No Admin rights</h1>"
 return render_template('login.html')

```