mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-16 10:19:17 +01:00
Update FollowUp time calculation method
This commit is contained in:
parent
13e42f1956
commit
cd77ac7a9d
@ -1003,7 +1003,12 @@ class FollowUp(models.Model):
|
|||||||
now = timezone.now()
|
now = timezone.now()
|
||||||
t = self.ticket
|
t = self.ticket
|
||||||
if helpdesk_settings.FOLLOWUP_TIME_SPENT_AUTO and not self.time_spent:
|
if helpdesk_settings.FOLLOWUP_TIME_SPENT_AUTO and not self.time_spent:
|
||||||
self.time_spent = now - t.modified
|
try:
|
||||||
|
latest_fup = t.followup_set.exclude(id=self.id).latest("date")
|
||||||
|
latest_time = latest_fup.date
|
||||||
|
except ObjectDoesNotExist:
|
||||||
|
latest_time = t.created
|
||||||
|
self.time_spent = now - latest_time
|
||||||
t.modified = now
|
t.modified = now
|
||||||
t.save()
|
t.save()
|
||||||
super(FollowUp, self).save(*args, **kwargs)
|
super(FollowUp, self).save(*args, **kwargs)
|
||||||
|
Loading…
Reference in New Issue
Block a user