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