fix: repaired RelatedDocument is_downref and is_approved_downref methods

This commit is contained in:
Robert Sparks 2023-07-07 16:14:18 -05:00
parent 3e57b9e82a
commit 632293d369
No known key found for this signature in database
GPG key ID: 6E2A6A5775F91318

View file

@ -686,7 +686,7 @@ class RelatedDocument(models.Model):
if source_lvl not in ['bcp','ps','ds','std']:
return None
if self.target.document.get_state().slug == 'rfc':
if self.target.document.type_id == 'rfc':
if not self.target.document.std_level:
target_lvl = 'unkn'
else:
@ -709,8 +709,8 @@ class RelatedDocument(models.Model):
def is_approved_downref(self):
if self.target.document.get_state().slug == 'rfc':
if RelatedDocument.objects.filter(relationship_id='downref-approval', target=self.target):
if self.target.document.type_id == "rfc":
if RelatedDocument.objects.filter(relationship_id='downref-approval', target=self.target).exists():
return "Approved Downref"
return False