diff --git a/action/views.py b/action/views.py index 1fdfe9d..36f3152 100644 --- a/action/views.py +++ b/action/views.py @@ -6,7 +6,8 @@ from action.models import State, StateDefinition from device.models import Device import logging -logger = logging.getLogger(__name__) + +device_logger = logging.getLogger('device_log') class NewActionView(View): @@ -26,9 +27,13 @@ class NewActionView(View): user=request.user, institution=request.user.institution, ) + #TODO: also change logger for full fledged table + device_logger.info( + f"Updated State to (key='{state_definition.state}', for device value='{snapshot_uuid}') by user {self.request.user}." + ) messages.success(request, f"Action to '{state_definition.state}' has been added.") return redirect(request.META.get('HTTP_REFERER')) else: messages.error(request, "There was an error with your submission.") - return redirect(request.META.get('HTTP_REFERER')) \ No newline at end of file + return redirect(request.META.get('HTTP_REFERER')) diff --git a/device/templates/details.html b/device/templates/details.html index 16f973c..51ef5b5 100644 --- a/device/templates/details.html +++ b/device/templates/details.html @@ -38,7 +38,7 @@ {% trans 'General details' %}