Fix some type annotations
This commit is contained in:
parent
570c09bca2
commit
2e20dbb0fe
@ -1,8 +1,10 @@
|
||||
import logging
|
||||
import re
|
||||
from fnmatch import fnmatch
|
||||
from typing import Union
|
||||
|
||||
from documents.classifier import DocumentClassifier
|
||||
from documents.data_models import ConsumableDocument
|
||||
from documents.data_models import DocumentSource
|
||||
from documents.models import Correspondent
|
||||
from documents.models import Document
|
||||
@ -238,7 +240,7 @@ def _split_match(matching_model):
|
||||
|
||||
|
||||
def document_matches_workflow(
|
||||
document, # ConsumableDocument | Document
|
||||
document: Union[ConsumableDocument, Document],
|
||||
workflow: Workflow,
|
||||
trigger_type: WorkflowTrigger.WorkflowTriggerType,
|
||||
) -> bool:
|
||||
|
@ -3,7 +3,6 @@ import math
|
||||
import re
|
||||
import zoneinfo
|
||||
from decimal import Decimal
|
||||
from typing import Any
|
||||
|
||||
import magic
|
||||
from celery import states
|
||||
@ -1451,7 +1450,7 @@ class WorkflowSerializer(serializers.ModelSerializer):
|
||||
if action.workflows.all().count() == 0:
|
||||
action.delete()
|
||||
|
||||
def create(self, validated_data: Any) -> Workflow:
|
||||
def create(self, validated_data) -> Workflow:
|
||||
if "triggers" in validated_data:
|
||||
triggers = validated_data.pop("triggers")
|
||||
|
||||
@ -1464,7 +1463,7 @@ class WorkflowSerializer(serializers.ModelSerializer):
|
||||
|
||||
return instance
|
||||
|
||||
def update(self, instance: Any, validated_data: Any) -> Workflow:
|
||||
def update(self, instance: Workflow, validated_data) -> Workflow:
|
||||
if "triggers" in validated_data:
|
||||
triggers = validated_data.pop("triggers")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user