mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-29 16:23:18 +00:00
Chore: Remove dead code (#14817)
* Chore: remove unused is_file_ext_supported Nothing in production called it, only its own test. * Chore: remove unused Tag.parent_pk It was an alias of tn_parent_id used only by two test asserts, which now use tn_parent_id directly. * Chore: remove unused SanityCheckMessages summary properties has_global_issues was never referenced and total_issue_count was only asserted in tests. The two private issue counters that fed it are removed as well, and the tests assert on has_error and has_warning instead. * Chore: remove unused DocumentViewSet._has_document_permissions It duplicated has_document_operation_permissions and had no callers. * Chore: remove legacy DocumentParser base class Parsers are resolved through the parser registry and ParserProtocol now, and nothing referenced this class. Its now unused imports are removed too. * Chore: remove unused ColorField and DeprecatedColors No serializer used ColorField, and DeprecatedColors was only referenced by it. * Chore: remove unused RtlLanguageException A leftover from the old tesseract parser, nothing referenced it. * Chore: remove unused TASK_WORKERS setting An alias of CELERY_WORKER_CONCURRENCY that nothing read. PAPERLESS_TASK_WORKERS is unchanged. * Chore: remove unused GNUPG_HOME setting Nothing read it. The mail GPG code uses EMAIL_GNUPG_HOME. * Chore: remove unused test helpers Drops the shared_samples_dir fixture, MailAttachmentMock, _SHORT_TEXT and _make_extract_text, none of which any test used.
This commit is contained in:
1 parent
0399008fb7
commit
098694c6e4
14 files changed
+9
-293
No files matched your search
@@ -536,43 +536,6 @@ class DocumentTypeSerializer(MatchingModelSerializer, OwnedObjectSerializer):
|
||||
)
|
||||
|
||||
|
||||
class DeprecatedColors:
|
||||
COLOURS = (
|
||||
(1, "#a6cee3"),
|
||||
(2, "#1f78b4"),
|
||||
(3, "#b2df8a"),
|
||||
(4, "#33a02c"),
|
||||
(5, "#fb9a99"),
|
||||
(6, "#e31a1c"),
|
||||
(7, "#fdbf6f"),
|
||||
(8, "#ff7f00"),
|
||||
(9, "#cab2d6"),
|
||||
(10, "#6a3d9a"),
|
||||
(11, "#b15928"),
|
||||
(12, "#000000"),
|
||||
(13, "#cccccc"),
|
||||
)
|
||||
|
||||
|
||||
@extend_schema_field(
|
||||
serializers.ChoiceField(
|
||||
choices=DeprecatedColors.COLOURS,
|
||||
),
|
||||
)
|
||||
class ColorField(serializers.Field):
|
||||
def to_internal_value(self, data):
|
||||
for id, color in DeprecatedColors.COLOURS:
|
||||
if id == data:
|
||||
return color
|
||||
raise serializers.ValidationError
|
||||
|
||||
def to_representation(self, value):
|
||||
for id, color in DeprecatedColors.COLOURS:
|
||||
if color == value:
|
||||
return id
|
||||
return 1
|
||||
|
||||
|
||||
class TagSerializer(MatchingModelSerializer, OwnedObjectSerializer):
|
||||
def get_text_color(self, obj) -> str:
|
||||
try:
|
||||
|
||||
Reference in new issue
Block a user