--- a/swtr.py +++ b/swtr.py @@ -37,11 +37,15 @@ def validateSweet(payload): for i in payload: - if len(i['who']) and len(i['what']) and len(i['where']) and len(i['how']): - pass - else: + try: + if len(i['who']) and len(i['what']) and len(i['where']) and\ + len(i['how']) and len(i['created']): + pass + else: + return False + except KeyError: return False - return True + return True @app.before_request def init_db(): --- a/templates/layout.html +++ b/templates/layout.html @@ -11,9 +11,11 @@

SWeeT Store

+ Home | {% if not session.logged_in %} Log In {% else %} + Users | Add User | Log Out {% endif %} --- a/templates/show_entries.html +++ b/templates/show_entries.html @@ -1,26 +1,14 @@ {% extends "layout.html" %} {% block body %} - {% if session.logged_in %} -
-
-
Who:
-
-
What:
-
-
Where:
-
-
How:
-
-
-
-
- {% endif %}