Early reject when user is anonymous.

This cuts down on info-level log entries, and prevents some Mongo queries.
This commit is contained in:
2017-09-18 14:04:52 +02:00
parent c7b83d2d8b
commit eb954208b2

View File

@@ -118,6 +118,10 @@ def attract_project_view(extra_project_projections: dict=None, extension_props=F
# just pass everything along.
return wrapped(project_url, *args, **kwargs)
if current_user.is_anonymous:
log.debug('attract_project_view: Anonymous user never has access to Attract.')
raise wz_exceptions.Forbidden()
api = pillar_api()
projection_param = None if full_project else {'projection': projections}