fix(api): prefix class names on events actions (#12354)

* fix(api): prefix class names on events actions

* fix bulk delete
This commit is contained in:
Daniel Vaz Gaspar
2021-01-12 10:52:35 +00:00
committed by GitHub
parent 078a8a17a1
commit 0f731f27e4
6 changed files with 181 additions and 40 deletions

View File

@@ -112,8 +112,11 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
@protect()
@safe
@statsd_metrics
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.delete",
log_to_statsd=False,
)
@permission_name("delete")
@event_logger.log_this_with_context(log_to_statsd=False)
def delete(self, pk: int) -> Response:
"""Delete an annotation layer
---
@@ -163,7 +166,10 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
@safe
@statsd_metrics
@permission_name("post")
@event_logger.log_this_with_context(log_to_statsd=False)
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.post",
log_to_statsd=False,
)
def post(self) -> Response:
"""Creates a new Annotation Layer
---
@@ -223,7 +229,10 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
@safe
@statsd_metrics
@permission_name("put")
@event_logger.log_this_with_context(log_to_statsd=False)
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.put",
log_to_statsd=False,
)
def put(self, pk: int) -> Response:
"""Updates an Annotation Layer
---
@@ -290,7 +299,10 @@ class AnnotationLayerRestApi(BaseSupersetModelRestApi):
@safe
@statsd_metrics
@rison(get_delete_ids_schema)
@event_logger.log_this_with_context(log_to_statsd=False)
@event_logger.log_this_with_context(
action=lambda self, *args, **kwargs: f"{self.__class__.__name__}.bulk_delete",
log_to_statsd=False,
)
def bulk_delete(self, **kwargs: Any) -> Response:
"""Delete bulk Annotation layers
---