Skip to content

Commit 8ff59cd

Browse files
committed
Fixed some issues with a migration. The migration has been re-run on production.
- Legacy-Id: 14484
1 parent 922d38b commit 8ff59cd

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

ietf/submit/migrations/0024_create_rfc_yang_links.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from ietf.submit.checkers import DraftYangChecker
1515

1616
def get_file_name(draft):
17-
return os.path.join(settings.INTERNET_DRAFT_PATH, '%s-%s.txt'%(draft.name, draft.rev))
17+
return os.path.join(settings.INTERNET_ALL_DRAFTS_ARCHIVE_DIR, '%s-%s.txt'%(draft.name, draft.rev))
1818

1919
YANG_RFCS = [ 5717, 6021, 6022, 6087, 6095, 6241, 6243, 6470, 6536, 6643,
2020
6728, 6991, 7223, 7224, 7277, 7317, 7407, 7758, 7895, 7952, 8022, 8040,
@@ -29,8 +29,6 @@ def forwards(apps, schema_editor):
2929
draft = DocAlias.objects.get(name="rfc%s" % rfc_number).document
3030
submission = draft.submission_set.filter(rev=draft.rev).order_by('-id').first()
3131
if submission:
32-
prev_check = submission.checks.filter(checker=checker.name).order_by('-id').first()
33-
if prev_check and prev_check.message:
3432
result = checker.check_file_txt(get_file_name(draft))
3533
passed, message, errors, warnings, items = result
3634
items = json.loads(json.dumps(items))
@@ -49,14 +47,14 @@ def forwards(apps, schema_editor):
4947
moduleargs = '&'.join([ f.format(module=m) for m in modules])
5048
url = settings.SUBMIT_YANG_CATALOG_IMPACT_URL.format(moduleargs=moduleargs, draft=draft.name)
5149
desc = settings.SUBMIT_YANG_CATALOG_IMPACT_DESC.format(modules=','.join(modules), draft=draft.name)
52-
draft.documenturl_set.create(url=url, tag_id='yang-impact-analysis', desc=desc)
50+
draft.documenturl_set.create(url=url[:512], tag_id='yang-impact-analysis', desc=desc)
5351
# Yang module metadata URLs
5452
old_urls = draft.documenturl_set.filter(tag_id='yang-module-metadata')
5553
old_urls.delete()
5654
for module in modules:
5755
url = settings.SUBMIT_YANG_CATALOG_MODULE_URL.format(module=module)
5856
desc = settings.SUBMIT_YANG_CATALOG_MODULE_DESC.format(module=module)
59-
draft.documenturl_set.create(url=url, tag_id='yang-module-metadata', desc=desc)
57+
draft.documenturl_set.create(url=url[:512], tag_id='yang-module-metadata', desc=desc)
6058

6159
def backwards(apps, schema_editor):
6260
pass

0 commit comments

Comments
 (0)