Skip to content

Commit 27459c5

Browse files
committed
Fix import of stream states
- Legacy-Id: 3831
1 parent 39d5945 commit 27459c5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

redesign/importing/import-docs.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
from ietf.idrfc.models import RfcIndex, DraftVersions
2424
from ietf.idrfc.mirror_rfc_index import get_std_level_mapping, get_stream_mapping
2525
from ietf.ietfworkflows.models import StreamedID, AnnotationTag, ContentType, ObjectHistoryEntry, ObjectWorkflowHistoryEntry, ObjectAnnotationTagHistoryEntry, ObjectStreamHistoryEntry, StateObjectRelationMetadata
26-
import workflows.utils
2726
from ietf.wgchairs.models import ProtoWriteUp
2827

28+
from workflows.models import State as StateOld
29+
2930
document_name_to_import = None
3031
if len(sys.argv) > 1:
3132
document_name_to_import = sys.argv[1]
@@ -805,7 +806,13 @@ def import_from_idinternal(d, idinternal):
805806
pass
806807

807808
d.unset_state("draft-iesg")
808-
s = workflows.utils.get_state(o)
809+
try:
810+
# don't constrain on content type, it may be broken because of
811+
# the two databases in uses
812+
s = StateOld.objects.get(stateobjectrelation__content_id=o.pk)
813+
except StateOld.DoesNotExist:
814+
s = None
815+
809816
if s:
810817
try:
811818
# there may be a mismatch between the stream type and the

0 commit comments

Comments
 (0)