77import io
88import os
99import rfc2html
10- import time
1110
1211from typing import Optional , TYPE_CHECKING
1312from weasyprint import HTML as wpHTML
1413
1514from django .db import models
1615from django .core import checks
1716from django .core .cache import caches
18- from django .core .exceptions import ValidationError
1917from django .core .validators import URLValidator , RegexValidator
2018from django .urls import reverse as urlreverse
2119from django .contrib .contenttypes .models import ContentType
@@ -221,12 +219,8 @@ def _get_ref(self, meeting=None, meeting_doc_refs=settings.MEETING_DOC_HREFS):
221219 if not hasattr (self , '_cached_href' ):
222220 validator = URLValidator ()
223221 if self .external_url and self .external_url .split (':' )[0 ] in validator .schemes :
224- try :
225- validator (self .external_url )
226- return self .external_url
227- except ValidationError :
228- log .unreachable ('2018-12-28' )
229- pass
222+ validator (self .external_url )
223+ return self .external_url
230224
231225 if self .type_id in settings .DOC_HREFS and self .type_id in meeting_doc_refs :
232226 if self .meeting_related ():
@@ -582,7 +576,6 @@ def pdfized(self):
582576 try :
583577 pdf = wpHTML (string = html .replace ('\xad ' ,'' )).write_pdf (stylesheets = [io .BytesIO (b'html { font-size: 94%;}' )])
584578 except AssertionError :
585- log .log (f'weasyprint failed with an assert on { self .name } ' )
586579 pdf = None
587580 if pdf :
588581 cache .set (cache_key , pdf , settings .PDFIZER_CACHE_TIME )
@@ -819,16 +812,12 @@ def save_with_history(self, events):
819812 assert events , "You must always add at least one event to describe the changes in the history log"
820813 self .time = max (self .time , events [0 ].time )
821814
822- mark = time .time ()
823815 self ._has_an_event_so_saving_is_allowed = True
824816 self .save ()
825817 del self ._has_an_event_so_saving_is_allowed
826- log .log (f'{ time .time ()- mark :.3f} seconds to save { self .name } Document' )
827818
828- mark = time .time ()
829819 from ietf .doc .utils import save_document_in_history
830820 save_document_in_history (self )
831- log .log (f'{ time .time ()- mark :.3f} seconds to save { self .name } DocHistory' )
832821
833822 def save (self , * args , ** kwargs ):
834823 # if there's no primary key yet, we can allow the save to go
@@ -1235,11 +1224,7 @@ def get_dochistory(self):
12351224
12361225 def __str__ (self ):
12371226 return u"%s %s by %s at %s" % (self .doc .name , self .get_type_display ().lower (), self .by .plain_name (), self .time )
1238-
1239- def save (self , * args , ** kwargs ):
1240- super (DocEvent , self ).save (* args , ** kwargs )
1241- log .assertion ('self.rev != None' )
1242-
1227+
12431228 class Meta :
12441229 ordering = ['-time' , '-id' ]
12451230 indexes = [
@@ -1421,4 +1406,4 @@ class BofreqEditorDocEvent(DocEvent):
14211406
14221407class BofreqResponsibleDocEvent (DocEvent ):
14231408 """ Capture the responsible leadership (IAB and IESG members) for a BOF Request """
1424- responsible = models .ManyToManyField ('person.Person' , blank = True )
1409+ responsible = models .ManyToManyField ('person.Person' , blank = True )
0 commit comments