From d13d878103db8e4bb9242708cfc9c0a77eb60548 Mon Sep 17 00:00:00 2001
From: Robert Sparks <rjsparks@nostrum.com>
Date: Sat, 6 Mar 2021 16:18:01 +0000
Subject: [PATCH] Only log an error for is_rfc vs canonical_name mismatch for
 Document objects - it's OK for DocHistory to have the mismatch given how
 DocHistory computes is_rfc()  - Legacy-Id: 18903

---
 ietf/doc/models.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ietf/doc/models.py b/ietf/doc/models.py
index e07f27c1c..c43127aea 100644
--- a/ietf/doc/models.py
+++ b/ietf/doc/models.py
@@ -371,7 +371,8 @@ class DocumentInfo(models.Model):
                 if n.startswith("rfc"):
                     self._cached_rfc_number = n[3:]
                 else:
-                    logger.error("Document self.is_rfc() is True but self.canonical_name() is %s" % n)
+                    if isinstance(self,Document):
+                        logger.error("Document self.is_rfc() is True but self.canonical_name() is %s" % n)
         return self._cached_rfc_number
 
     @property