mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-09 08:05:13 +02:00
Better workflow for creating new ticket checklist, into a modal
This commit is contained in:
@ -2028,12 +2028,6 @@ class ChecklistTemplate(models.Model):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def create_checklist_for_ticket(self, ticket):
|
||||
checklist = ticket.checklists.create(name=self.name)
|
||||
for position, task in enumerate(self.task_list):
|
||||
checklist.tasks.create(description=task, position=position)
|
||||
return checklist
|
||||
|
||||
|
||||
class Checklist(models.Model):
|
||||
ticket = models.ForeignKey(
|
||||
@ -2054,6 +2048,10 @@ class Checklist(models.Model):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
def create_tasks_from_template(self, template):
|
||||
for position, task in enumerate(template.task_list):
|
||||
self.tasks.create(description=task, position=position)
|
||||
|
||||
|
||||
class ChecklistTaskQuerySet(models.QuerySet):
|
||||
def todo(self):
|
||||
|
Reference in New Issue
Block a user