Refactoring to handle not logged in users

This commit is contained in:
2014-09-10 17:29:59 +02:00
parent 4b6b889e20
commit 4f0bcc4eb5

View File

@@ -13,12 +13,11 @@ from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound
# Views
@app.route('/')
def homepage():
latest_application = None
if current_user.is_authenticated():
applications = Application.query\
.filter_by(blender_id=current_user.id)\
.all()
latest_application = None
for application in applications:
if application.status != 'rejected':
latest_application = application