|
20 | 20 | from django.db import transaction |
21 | 21 | from django.http import HttpRequest # pyflakes:ignore |
22 | 22 | from django.utils.module_loading import import_string |
23 | | -from django.template.loader import render_to_string |
24 | 23 | from django.contrib.auth.models import AnonymousUser |
25 | 24 | from django.utils import timezone |
26 | 25 |
|
|
30 | 29 | DocumentAuthor, AddedMessageEvent ) |
31 | 30 | from ietf.doc.models import NewRevisionDocEvent |
32 | 31 | from ietf.doc.models import RelatedDocument, DocRelationshipName, DocExtResource |
33 | | -from ietf.doc.utils import add_state_change_event, rebuild_reference_relations |
34 | | -from ietf.doc.utils import ( set_replaces_for_document, prettify_std_name, |
35 | | - update_doc_extresources, can_edit_docextresources, update_documentauthors, update_action_holders ) |
| 32 | +from ietf.doc.utils import (add_state_change_event, rebuild_reference_relations, |
| 33 | + set_replaces_for_document, prettify_std_name, update_doc_extresources, |
| 34 | + can_edit_docextresources, update_documentauthors, update_action_holders, |
| 35 | + bibxml_for_draft ) |
36 | 36 | from ietf.doc.mails import send_review_possibly_replaces_request, send_external_resource_change_request |
37 | 37 | from ietf.group.models import Group |
38 | 38 | from ietf.ietfauth.utils import has_role |
@@ -486,14 +486,7 @@ def post_submission(request, submission, approved_doc_desc, approved_subm_desc): |
486 | 486 | create_submission_event(request, submission, approved_subm_desc) |
487 | 487 |
|
488 | 488 | # Create bibxml-ids entry |
489 | | - ref_text = '%s' % render_to_string('doc/bibxml.xml', {'name':draft.name, 'doc': draft, 'doc_bibtype':'I-D'}) |
490 | | - # for name in (draft.name, draft.name[6:]): |
491 | | - # ref_file_name = os.path.join(os.path.join(settings.BIBXML_BASE_PATH, 'bibxml-ids'), 'reference.I-D.%s.xml' % (name, )) |
492 | | - # with io.open(ref_file_name, "w", encoding='utf-8') as f: |
493 | | - # f.write(ref_text) |
494 | | - # ref_rev_file_name = os.path.join(os.path.join(settings.BIBXML_BASE_PATH, 'bibxml-ids'), 'reference.I-D.%s-%s.xml' % (name, draft.rev )) |
495 | | - # with io.open(ref_rev_file_name, "w", encoding='utf-8') as f: |
496 | | - # f.write(ref_text) |
| 489 | + ref_text = bibxml_for_draft(draft, draft.rev) |
497 | 490 | ref_rev_file_name = os.path.join(os.path.join(settings.BIBXML_BASE_PATH, 'bibxml-ids'), 'reference.I-D.%s-%s.xml' % (draft.name, draft.rev )) |
498 | 491 | with io.open(ref_rev_file_name, "w", encoding='utf-8') as f: |
499 | 492 | f.write(ref_text) |
|
0 commit comments