add tzinfo for calculating
This commit is contained in:
parent
dae777892b
commit
e66d729b62
@ -1,7 +1,7 @@
|
|||||||
import uuid
|
import uuid
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from datetime import datetime
|
from datetime import datetime, timezone
|
||||||
from . import utils
|
from . import utils
|
||||||
from . import tasks
|
from . import tasks
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
@ -58,7 +58,7 @@ class Client(models.Model):
|
|||||||
t = Accounting.objects.filter(client_id=self.id, desk_no=desk_no)[:3][::-1]
|
t = Accounting.objects.filter(client_id=self.id, desk_no=desk_no)[:3][::-1]
|
||||||
a = t[t.__len__() - 1]
|
a = t[t.__len__() - 1]
|
||||||
if a.time_to is None:
|
if a.time_to is None:
|
||||||
prize = utils.get_prize_for(start=a.time_from, end=datetime.now(), pph=pht)
|
prize = utils.get_prize_for(start=a.time_from, end=datetime.now(timezone.utc), pph=pht)
|
||||||
if prize != a.prize:
|
if prize != a.prize:
|
||||||
a.prize = prize
|
a.prize = prize
|
||||||
return t
|
return t
|
||||||
|
Loading…
Reference in New Issue
Block a user