mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-21 23:43:11 +01:00
Automatic absolute time_spent calculation for ticket FollowUp
This commit is contained in:
parent
f379bbe80e
commit
f7e3a2b8aa
@ -1000,8 +1000,11 @@ class FollowUp(models.Model):
|
||||
return u"%s#followup%s" % (self.ticket.get_absolute_url(), self.id)
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
now = timezone.now()
|
||||
t = self.ticket
|
||||
t.modified = timezone.now()
|
||||
if helpdesk_settings.FOLLOWUP_TIME_SPENT_AUTO and not self.time_spent:
|
||||
self.time_spent = now - t.modified
|
||||
t.modified = now
|
||||
t.save()
|
||||
super(FollowUp, self).save(*args, **kwargs)
|
||||
|
||||
|
@ -151,6 +151,11 @@ TICKET_PRIORITY_CHOICES = getattr(settings,
|
||||
'HELPDESK_TICKET_PRIORITY_CHOICES',
|
||||
DEFAULT_TICKET_PRIORITY_CHOICES)
|
||||
|
||||
# Follow-ups automatic time_spent calculation
|
||||
FOLLOWUP_TIME_SPENT_AUTO = getattr(settings,
|
||||
'HELPDESK_FOLLOWUP_TIME_SPENT_AUTO',
|
||||
False)
|
||||
|
||||
############################
|
||||
# options for public pages #
|
||||
############################
|
||||
|
Loading…
Reference in New Issue
Block a user