@@ -2631,7 +2631,6 @@ def clear_and_lock_register(self):
2631
2631
# We set the user's current transaction to None and dismiss
2632
2632
# the current register page, most likely returning to the lock
2633
2633
# screen on the next time around the event loop.
2634
- self .user .dbuser = td .s .get (User , self .user .userid )
2635
2634
self .user .dbuser .transaction = None
2636
2635
td .s .flush ()
2637
2636
self .deselect ()
@@ -2640,7 +2639,6 @@ def recalltrans(self, transid):
2640
2639
# We refresh the user object as if in enter() here, but don't
2641
2640
# bother with the full works because we're replacing the current
2642
2641
# transaction anyway!
2643
- self .user .dbuser = td .s .get (User , self .user .userid )
2644
2642
self ._clear ()
2645
2643
self ._redraw ()
2646
2644
if transid :
@@ -3202,14 +3200,6 @@ def entry(self):
3202
3200
it isn't. If False is returned, this function may have popped
3203
3201
up a dialog box.
3204
3202
"""
3205
- # Fetch the current user database object. We don't recreate
3206
- # the user.database_user object because that's unlikely to
3207
- # change often; we're just interested in the transaction and
3208
- # register fields. The fetch from the database has probably
3209
- # already been done in hotkeypress() - here we are fetching
3210
- # from the sqlalchemy session's map
3211
- self .user .dbuser = td .s .get (User , self .user .userid )
3212
-
3213
3203
# This check has already been done in hotkeypress(). We
3214
3204
# repeat it here because it is possible we may not have been
3215
3205
# entered in response to a keypress - a timer event, for
@@ -3259,7 +3249,6 @@ def entry_noninteractive(self):
3259
3249
If this returns False, the caller should clean up and then
3260
3250
call the deselect() method.
3261
3251
"""
3262
- self .user .dbuser = td .s .get (User , self .user .userid )
3263
3252
if self .user .dbuser .register_id != tillconfig .register_id :
3264
3253
# User has logged in somewhere else
3265
3254
return False
@@ -3369,13 +3358,13 @@ def hotkeypress(self, k):
3369
3358
# the user.database_user object because that's unlikely to
3370
3359
# change often; we're just interested in the transaction and
3371
3360
# register fields.
3372
- self . user . dbuser = td .s .get (
3361
+ dbuser = td .s .get (
3373
3362
User , self .user .userid ,
3374
3363
options = [joinedload (User .transaction )])
3375
3364
3376
3365
# Check that the user hasn't moved to another terminal. If
3377
3366
# they have, lock immediately.
3378
- if self . user . dbuser .register_id != tillconfig .register_id :
3367
+ if dbuser .register_id != tillconfig .register_id :
3379
3368
self .deselect ()
3380
3369
return super ().hotkeypress (k )
3381
3370
0 commit comments