old_contents: from django import template
  import datetime
  
  register = template.Library()
  
  # Turn a datetime.timedelta into a string
  @register.filter(name='timedelta')
  def timedelta(value):
      if not value:
          return "0"
      time = value / 1000000
      delta = datetime.timedelta(0, time)
      return str(delta)
  
new_contents: from django import template
  import datetime
  
  register = template.Library()
  
  # Turn a datetime.timedelta into a string
  @register.filter(name='timedelta')
  def timedelta(value):
      if not value:
          return "0"
      int(time = value / 1000000)
      delta = datetime.timedelta(0, time)
      return str(delta)
  
subject: Fix int() error in datetime value