[FIX] BIOMETRIC: Add on delete attribute for biometricemployees model

This commit is contained in:
Horilla
2024-11-04 10:20:37 +05:30
parent 0499cb6aa4
commit 312769d39d
2 changed files with 4 additions and 4 deletions

View File

@@ -221,7 +221,7 @@ class BiometricEmployees(models.Model):
null=True, blank=True, validators=[MaxValueValidator(99999999)]
)
user_id = models.CharField(max_length=100)
employee_id = models.ForeignKey(Employee, on_delete=models.DO_NOTHING)
employee_id = models.ForeignKey(Employee, on_delete=models.CASCADE)
device_id = models.ForeignKey(
BiometricDevices, on_delete=models.CASCADE, null=True, blank=True
)

View File

@@ -1730,12 +1730,12 @@ def biometric_device_live(request):
)
response = cosec.basic_config()
if response.get("app"):
thread = COSECBioAttendanceThread(device.id)
thread.start()
BIO_DEVICE_THREADS[device.id] = thread
device.is_live = True
device.is_scheduler = False
device.save()
thread = COSECBioAttendanceThread(device.id)
thread.start()
BIO_DEVICE_THREADS[device.id] = thread
else:
raise TimeoutError
else: