normalized deviceLog messages
This commit is contained in:
parent
5783a00318
commit
60b1e394e5
|
@ -27,7 +27,7 @@ class ChangeStateView(View):
|
||||||
institution=self.request.user.institution,
|
institution=self.request.user.institution,
|
||||||
)
|
)
|
||||||
|
|
||||||
message = _("State changed from '{}' to '{}'.".format(previous_state, new_state) )
|
message = _("<Created> State '{}'. Previous State: '{}' ".format(new_state, previous_state) )
|
||||||
DeviceLog.objects.create(
|
DeviceLog.objects.create(
|
||||||
snapshot_uuid=snapshot_uuid,
|
snapshot_uuid=snapshot_uuid,
|
||||||
event=message,
|
event=message,
|
||||||
|
@ -68,7 +68,7 @@ class AddNoteView(View):
|
||||||
institution=self.request.user.institution,
|
institution=self.request.user.institution,
|
||||||
)
|
)
|
||||||
|
|
||||||
message = _("Note: '{}' ".format(note) )
|
message = _("<Created> Note: '{}' ".format(note) )
|
||||||
DeviceLog.objects.create(
|
DeviceLog.objects.create(
|
||||||
snapshot_uuid=snapshot_uuid,
|
snapshot_uuid=snapshot_uuid,
|
||||||
event=message,
|
event=message,
|
||||||
|
|
|
@ -190,7 +190,7 @@ class AddUserPropertyView(DashboardView, CreateView):
|
||||||
form.instance.uuid = self.property.uuid
|
form.instance.uuid = self.property.uuid
|
||||||
form.instance.type = UserProperty.Type.USER
|
form.instance.type = UserProperty.Type.USER
|
||||||
|
|
||||||
message = _("New annotation: {}: {}".format(form.instance.key, form.instance.value))
|
message = _("<Created> UserProperty: {}: {}".format(form.instance.key, form.instance.value))
|
||||||
DeviceLog.objects.create(
|
DeviceLog.objects.create(
|
||||||
snapshot_uuid=form.instance.uuid,
|
snapshot_uuid=form.instance.uuid,
|
||||||
event=message,
|
event=message,
|
||||||
|
@ -247,7 +247,7 @@ class UpdateUserPropertyView(DashboardView, UpdateView):
|
||||||
response = super().form_valid(form)
|
response = super().form_valid(form)
|
||||||
messages.success(self.request, _("User property updated successfully."))
|
messages.success(self.request, _("User property updated successfully."))
|
||||||
|
|
||||||
message = _("Update annotation: {}: {} to {}:{}".format(old_key, old_value, new_key, new_value ))
|
message = _("<Updated> UserProperty: {}: {} to {}: {}".format(old_key, old_value, new_key, new_value ))
|
||||||
DeviceLog.objects.create(
|
DeviceLog.objects.create(
|
||||||
snapshot_uuid=form.instance.uuid,
|
snapshot_uuid=form.instance.uuid,
|
||||||
event=message,
|
event=message,
|
||||||
|
@ -274,7 +274,7 @@ class DeleteUserPropertyView(DashboardView, DeleteView):
|
||||||
pk=self.pk,
|
pk=self.pk,
|
||||||
owner=self.request.user.institution
|
owner=self.request.user.institution
|
||||||
)
|
)
|
||||||
message = _("deleted annotation: {}:{}".format(self.object.key, self.object.value ))
|
message = _("<Deleted> User Property: {}:{}".format(self.object.key, self.object.value ))
|
||||||
DeviceLog.objects.create(
|
DeviceLog.objects.create(
|
||||||
snapshot_uuid=self.object.uuid,
|
snapshot_uuid=self.object.uuid,
|
||||||
event=message,
|
event=message,
|
||||||
|
|
Loading…
Reference in a new issue