Skip to content

Commit

Permalink
Fix checkout_from_location function parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Pancham1603 committed Dec 6, 2023
1 parent f9d98a9 commit 7eb5d09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/validation/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json
from datetime import datetime, date, timedelta
import requests
from django.utils import timezone
from django.utils import timezone
# Create your views here.

def fetch_user_status(request):
Expand Down Expand Up @@ -155,7 +155,7 @@ def checkout_from_hostel(user_pass:NightPass, direct:bool=True):
data['student_stats'] = None
return HttpResponse(json.dumps(data))

def checkout_from_location(user_pass, admin_campus_resource:CampusResource ,direct:bool=True, ):
def checkout_from_location(user_pass, admin_campus_resource:CampusResource=None ,direct:bool=True, ):
user = user_pass.user
if not is_repeated_scan(user_pass):
user.student.last_checkout_time = datetime.now() if direct else None
Expand Down Expand Up @@ -220,7 +220,7 @@ def checkin_to_hostel(user:Student):
user_pass.valid = False
user_pass.save()
if (not user_pass.check_out if user_pass else False):
checkout_from_location(user_pass, direct=False)
checkout_from_location(user_pass,admin_campus_resource=user_pass.campus_resource ,direct=False)
data = {
'status':True,
'message':'Successfully checked in!'
Expand Down

0 comments on commit 7eb5d09

Please sign in to comment.