Don't insert references to self.
Move the data filler from a migration to a standalone script - Legacy-Id: 6620
This commit is contained in:
parent
b18249222b
commit
e309ff92b3
ietf
File diff suppressed because it is too large
Load diff
|
@ -321,7 +321,9 @@ def rebuild_reference_relations(doc):
|
|||
elif count > 1:
|
||||
errors.append("Too many DocAlias objects found for %s"%ref)
|
||||
else:
|
||||
RelatedDocument.objects.get_or_create( source=doc, target=refdoc[ 0 ], relationship=DocRelationshipName.objects.get( slug='ref%s' % refType ) )
|
||||
# Don't add references to ourself
|
||||
if doc != refdoc[0].document:
|
||||
RelatedDocument.objects.get_or_create( source=doc, target=refdoc[ 0 ], relationship=DocRelationshipName.objects.get( slug='ref%s' % refType ) )
|
||||
if unfound:
|
||||
warnings.append('There were %d references with no matching DocAlias'%len(unfound))
|
||||
|
||||
|
|
306417
ietf/patches/fill_in_references.py
Normal file
306417
ietf/patches/fill_in_references.py
Normal file
File diff suppressed because it is too large
Load diff
|
@ -977,10 +977,11 @@ class Draft():
|
|||
for boilerplate in ( 'bcp78', 'bcp79' ):
|
||||
if refs.get( boilerplate ) == 'unk':
|
||||
del refs[ boilerplate ]
|
||||
# Don't add any references that point back into this doc
|
||||
if self.filename in refs:
|
||||
del refs[self.filename]
|
||||
return refs
|
||||
|
||||
|
||||
|
||||
def old_get_refs( self ):
|
||||
refs = []
|
||||
normrefs = []
|
||||
|
|
Loading…
Reference in a new issue