code: def get_notification_options(user):
      
  
      notification_options = {}
      notification_options["receive_news_emails"] = user.receive_news_emails
      notification_options["receive_eighth_emails"] = user.receive_eighth_emails
      try:
          notification_options["primary_email"] = user.primary_email
      except Email.DoesNotExist:
          user.primary_email = None
          user.save()
          notification_options["primary_email"] = None
  
      return notification_options
docs: Get a user's notification options to pass as an initial value to a
      NotificationOptionsForm.