def log_module_component_changes(sender, module, component, user, **kwargs):
with translation.override(settings.DEFAULT_LANGUAGE):
message = _(
'"{username}" modified the component "{component_label}"'
' in the module "{module_name}"'
' of the project "{project_name}".').format(
username=user.username,
project_name=module.project.name,
module_name=module.name,
component_label=component.label)
models.LogEntry.objects.create(
message=message,
action=models.MODULE_COMPONENT_UPDATED,
actor=user,
component_identifier=component.identifier,
project=module.project,
module=module,
)
评论列表
文章目录