feat: datetime_now helper util
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
from datetime import timedelta
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.shortcuts import redirect
|
||||
from django.utils import timezone
|
||||
from django.views import View
|
||||
|
||||
from app.base.forms.utils import datetime_now
|
||||
from app.base.models import Person, Booking, BookingType
|
||||
|
||||
|
||||
@@ -12,8 +11,7 @@ class ToggleCheckinView(LoginRequiredMixin, View):
|
||||
user = Person.objects.get(id=kwargs['user_id'])
|
||||
next = self.request.GET.get('next')
|
||||
booking = user.current_checkin # performs db query
|
||||
now = timezone.now()
|
||||
now -= timedelta(microseconds=now.microsecond) # remove precision
|
||||
now = datetime_now()
|
||||
|
||||
if booking:
|
||||
booking.end_time = now
|
||||
|
||||
Reference in New Issue
Block a user