mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-15 11:07:00 +01:00
Handcrafts SQL queries a little more to reduce the query count and/or the amount of returned data (#6489)
This commit is contained in:
parent
63e1f9f5d3
commit
7be7185418
10 changed files with 188 additions and 135 deletions
|
|
@ -16,9 +16,13 @@ def changed_password_check(app_configs, **kwargs):
|
|||
from paperless.db import GnuPG
|
||||
|
||||
try:
|
||||
encrypted_doc = Document.objects.filter(
|
||||
storage_type=Document.STORAGE_TYPE_GPG,
|
||||
).first()
|
||||
encrypted_doc = (
|
||||
Document.objects.filter(
|
||||
storage_type=Document.STORAGE_TYPE_GPG,
|
||||
)
|
||||
.only("pk", "storage_type")
|
||||
.first()
|
||||
)
|
||||
except (OperationalError, ProgrammingError, FieldError):
|
||||
return [] # No documents table yet
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue