Skip to content

Commit

Permalink
bug fixes and SQL explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
Pancham1603 committed Dec 12, 2023
1 parent fe3ec3d commit 1127fa3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions apps/users/management/commands/check_defaulters.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def check_defaulters():

if nightpass.hostel_checkout_time:
if (nightpass.check_in_time - nightpass.hostel_checkout_time) > timedelta(minutes=checkin_timer):
if (nightpass.check_in_time > start_default_time):
if (nightpass.check_in_time.time() > start_default_time):
defaulter = True
remarks+= f"Late check in at {nightpass.campus_resource.name}"
else:
if (nightpass.check_in_time > end_default_time):
if (nightpass.check_in_time > end_default_time.time()):
defaulter = True
remarks+= f"Late check in at {nightpass.campus_resource.name}"
if not nightpass.check_out_time:
Expand Down
4 changes: 2 additions & 2 deletions apps/validation/templates/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ <h3 id="total_count">Booking: {{ total_count }}</h3><br>
var audio = new Audio('../static/beep.mp3');
audio.play();
if (code.length == 9) {fetch_data({'registration_number':code})}
lastScannedBarcode.concat(code);
lastScannedBarcode.push(code);
}

});
Expand All @@ -109,7 +109,7 @@ <h3 id="total_count">Booking: {{ total_count }}</h3><br>

setInterval(function () {
lastScannedBarcode.pop();
}, 10000);
}, 5000);
</script>
<script src="../static/info.js"></script>
</body>
Expand Down
17 changes: 16 additions & 1 deletion core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
'django_crontab',
'hijack',
'hijack.contrib.admin',
'rangefilter'
'rangefilter',
'explorer'
]


Expand Down Expand Up @@ -195,3 +196,17 @@
# ]

# CRONTAB_TIME_ZONE = 'Asia/Kolkata'

EXPLORER_CONNECTIONS = { 'Default': 'default' }
EXPLORER_DEFAULT_CONNECTION = 'default'

EXPLORER_SCHEMA_EXCLUDE_TABLE_PREFIXES = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin'
)

EXPLORER_PERMISSION_CHANGE = lambda r: r.user.is_superuser
EXPLORER_PERMISSION_VIEW = lambda r: r.user.is_superuser

2 changes: 2 additions & 0 deletions core/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@
path('accounts/google/login/callback/', user_views.oauth_callback),
path('access/', include("apps.validation.urls")),
path('hijack/', include('hijack.urls')),
path('explorer/', include('explorer.urls')),
]

0 comments on commit 1127fa3

Please sign in to comment.