modify ld processing
This commit is contained in:
parent
1ecb96f520
commit
b46bd28ad6
@ -127,16 +127,17 @@ def process_location_data():
|
||||
desk = desk[0]
|
||||
ac = desk.accounting_set.order_by('time_from').reverse()
|
||||
if ld.on_off:
|
||||
acc = None
|
||||
if ac.count() > 0 and ac[0].time_to is None:
|
||||
ac[0].time_to = ld.tst
|
||||
ac[0].save()
|
||||
mail_admins(subject='Accounting passt nicht',
|
||||
message='Vorheriges Accounting nicht abgeschlossen: Desk_id {}, Accounting_id {}'
|
||||
.format(desk.id, ac[0].id))
|
||||
acc = Accounting(
|
||||
desk=desk,
|
||||
time_from=ld.tst,
|
||||
)
|
||||
acc = ac[0]
|
||||
if acc is None:
|
||||
acc = Accounting(
|
||||
desk=desk,
|
||||
time_from=ld.tst,
|
||||
)
|
||||
acc.save()
|
||||
ld.delete()
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user