mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	Use datetime.now() instead of document.created for LogEntry action_time
This commit is contained in:
		@@ -3,9 +3,11 @@ import os
 | 
				
			|||||||
from subprocess import Popen
 | 
					from subprocess import Popen
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from django.conf import settings
 | 
					from django.conf import settings
 | 
				
			||||||
from django.contrib.admin.models import LogEntry, ADDITION
 | 
					from django.contrib.admin.models import ADDITION, LogEntry
 | 
				
			||||||
from django.contrib.contenttypes.models import ContentType
 | 
					 | 
				
			||||||
from django.contrib.auth.models import User
 | 
					from django.contrib.auth.models import User
 | 
				
			||||||
 | 
					from django.contrib.contenttypes.models import ContentType
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from datetime import datetime
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from ..models import Correspondent, Document, Tag
 | 
					from ..models import Correspondent, Document, Tag
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -105,7 +107,7 @@ def set_log_entry(sender, document=None, logging_group=None, **kwargs):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    LogEntry.objects.create(
 | 
					    LogEntry.objects.create(
 | 
				
			||||||
        action_flag=ADDITION,
 | 
					        action_flag=ADDITION,
 | 
				
			||||||
        action_time=document.created,
 | 
					        action_time=datetime.now(),
 | 
				
			||||||
        content_type=ct,
 | 
					        content_type=ct,
 | 
				
			||||||
        object_id=document.id,
 | 
					        object_id=document.id,
 | 
				
			||||||
        user=user,
 | 
					        user=user,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user