From 6ff052b5e880fd1a36b004cd768a93c87f10ed4c Mon Sep 17 00:00:00 2001 From: fbormann Date: Tue, 4 Jun 2019 22:42:54 -0300 Subject: [PATCH] refactor(log/mixins.py): remove LogMixin from codebase so we don't have a mixin for it anymore #648 --- log/mixins.py | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/log/mixins.py b/log/mixins.py index 75b1e626d..cc1855878 100755 --- a/log/mixins.py +++ b/log/mixins.py @@ -10,36 +10,3 @@ Você deve ter recebido uma cópia da Licença Pública Geral GNU, sob o título "LICENSE", junto com este programa, se não, escreva para a Fundação do Software Livre (FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. """ -from .models import Log - - -class LogMixin(object): - log_component = None - log_action = None - log_resource = None - - def create_log(self, actor=None, component='', log_action='', log_resource=''): - if actor.is_authenticated: - log = Log() - log.user = str(actor) - log.user_id = actor.id - log.user_email = actor.email - - if self.log_component is not None: - log.component = self.log_component - else: - log.component = component - - if self.log_action is not None: - log.action = self.log_action - else: - log.action = log_action - if self.log_resource is not None: - log.resource = self.log_resource - else: - log.resource = log_resource - - log.save() - - def dispatch(self, request, *args, **kwargs): - return super(LogMixin, self).dispatch(request, *args, **kwargs)