fix(log): log endpoint authentication (#10435)

* fix(log): log crashes if expired or not authenticated

* add auth to log endpoint
This commit is contained in:
Daniel Vaz Gaspar 2020-07-29 09:32:10 +01:00 committed by GitHub
parent 473fe1003a
commit 0aad9c6f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -42,7 +42,7 @@ class AbstractEventLogger(ABC):
@functools.wraps(f)
def wrapper(*args: Any, **kwargs: Any) -> Any:
user_id = None
if g.user:
if hasattr(g, "user") and g.user:
user_id = g.user.get_id()
payload = request.form.to_dict() or {}

View File

@ -1690,6 +1690,7 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
@api
@event_logger.log_this
@has_access
@expose("/log/", methods=["POST"])
def log(self) -> FlaskResponse: # pylint: disable=no-self-use
return Response(status=200)