[UPDT] HORILLA: Prevent duplicate select2 event triggers on HTMX updates

This commit is contained in:
Horilla
2025-07-05 15:39:50 +05:30
parent 5cae06549a
commit f980d5daa3
8 changed files with 21 additions and 49 deletions

View File

@@ -24,10 +24,3 @@
</div>
</form>
</div>
<script>
$(document).ready(function () {
$("select").on("select2:select", function (e) {
$(this).closest("select")[0].dispatchEvent(new Event("change"));
});
});
</script>

View File

@@ -2322,9 +2322,9 @@ def zk_biometric_attendance_bulk_logs(devices):
datetime=date_time,
)
try:
if punch_code in {0, 3, 4, 5}:
if punch_code in {0, 3, 4}:
clock_in(request_data)
elif punch_code in {1, 2}:
elif punch_code in {1, 2, 5}:
clock_out(request_data)
except Exception as error:
logger.error(