Refactoring to handle not logged in users
This commit is contained in:
@@ -13,12 +13,11 @@ from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound
|
|||||||
# Views
|
# Views
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def homepage():
|
def homepage():
|
||||||
|
latest_application = None
|
||||||
if current_user.is_authenticated():
|
if current_user.is_authenticated():
|
||||||
applications = Application.query\
|
applications = Application.query\
|
||||||
.filter_by(blender_id=current_user.id)\
|
.filter_by(blender_id=current_user.id)\
|
||||||
.all()
|
.all()
|
||||||
|
|
||||||
latest_application = None
|
|
||||||
for application in applications:
|
for application in applications:
|
||||||
if application.status != 'rejected':
|
if application.status != 'rejected':
|
||||||
latest_application = application
|
latest_application = application
|
||||||
|
Reference in New Issue
Block a user