|
|
@ -18,7 +18,7 @@ def set_offline():
|
|
|
|
# Create a new connection record for each user with status set to 'Offline'
|
|
|
|
# Create a new connection record for each user with status set to 'Offline'
|
|
|
|
for user in users_without_working_points:
|
|
|
|
for user in users_without_working_points:
|
|
|
|
last_connection = Connection.objects.filter(user=user).order_by('-date').first()
|
|
|
|
last_connection = Connection.objects.filter(user=user).order_by('-date').first()
|
|
|
|
if last_connection is None or last_connection.status != 'Offline':
|
|
|
|
if last_connection.status != 'Offline':
|
|
|
|
Connection.objects.create(
|
|
|
|
Connection.objects.create(
|
|
|
|
status='Offline',
|
|
|
|
status='Offline',
|
|
|
|
date=timezone.now(),
|
|
|
|
date=timezone.now(),
|
|
|
|