code: def create_task(self, ):
          
          depi = self.dep_cb.currentIndex()
          assert depi >= 0
          dep = self.deps[depi]
          deadline = self.deadline_de.dateTime().toPython()
          try:
              task = djadapter.models.Task(department=dep, project=self.element.project, element=self.element, deadline=deadline)
              task.save()
              self.task = task
              self.accept()
          except:
              log.exception("Could not create new task")
docs: Create a task and store it in the self.task
  
          :returns: None
          :rtype: None
          :raises: None