Moves additional auditlog imports into protected blocks (#6638)

This commit is contained in:
Trenton H 2024-05-08 09:04:32 -07:00 committed by GitHub
parent f7db5f3821
commit d4d0604da2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -9,9 +9,6 @@ from typing import Optional
import tqdm
from django.conf import settings
if settings.AUDIT_LOG_ENABLED:
from auditlog.models import LogEntry
from django.contrib.auth.models import Group
from django.contrib.auth.models import Permission
from django.contrib.auth.models import User
@ -25,6 +22,9 @@ from filelock import FileLock
from guardian.models import GroupObjectPermission
from guardian.models import UserObjectPermission
if settings.AUDIT_LOG_ENABLED:
from auditlog.models import LogEntry
from documents.file_handling import delete_empty_directories
from documents.file_handling import generate_filename
from documents.models import Correspondent

View File

@ -5,7 +5,6 @@ import zoneinfo
from decimal import Decimal
import magic
from auditlog.context import set_actor
from celery import states
from django.conf import settings
from django.contrib.auth.models import Group
@ -28,6 +27,9 @@ from rest_framework import fields
from rest_framework import serializers
from rest_framework.fields import SerializerMethodField
if settings.AUDIT_LOG_ENABLED:
from auditlog.context import set_actor
from documents import bulk_edit
from documents.data_models import DocumentSource
from documents.models import Correspondent