Fix usage of user.transactions #31

Closed
opened 2026-01-25 10:37:49 +01:00 by oysteikt · 0 comments
Owner
[Dibbler main menu]
 1 ) Buy
 2 ) Product list
 3 ) Show user
 4 ) User list
 5 ) Adjust credit
 6 ) Transfer credit between users
 7 ) Add stock and adjust credit
 8 ) Add/edit
 9 ) Product search
10 ) Statistics
11 ) Frequently Asked Questions
12 ) Print a label
> 3

[Show user]
User name, card number or RFID> asdf
User name: asdf
Card number: None
RFID: None
Credit: 0 kr
What do you want to know about asdf?
1 ) Recent transactions (List of last 100)
2 ) Which products asdf has bought, and how many
3 ) Everything (List of all transactions)
select> 1
Something went wrong.
<class 'TypeError'>: 'InstrumentedSet' object is not subscriptable
  File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/subcommands/loop.py", line 66, in main
    main.execute()
  File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/helpermenus.py", line 491, in execute
    return self._execute(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/helpermenus.py", line 512, in _execute
    self.items[item_i].execute()
  File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/helpermenus.py", line 491, in execute
    return self._execute(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/miscmenus.py", line 69, in _execute
    self.print_transactions(user, config["limits"]["user_recent_transaction_limit"])
  File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/miscmenus.py", line 86, in print_transactions
    for t in user.transactions[-1 : -limit - 1 : -1]:
``` [Dibbler main menu] 1 ) Buy 2 ) Product list 3 ) Show user 4 ) User list 5 ) Adjust credit 6 ) Transfer credit between users 7 ) Add stock and adjust credit 8 ) Add/edit 9 ) Product search 10 ) Statistics 11 ) Frequently Asked Questions 12 ) Print a label > 3 [Show user] User name, card number or RFID> asdf User name: asdf Card number: None RFID: None Credit: 0 kr What do you want to know about asdf? 1 ) Recent transactions (List of last 100) 2 ) Which products asdf has bought, and how many 3 ) Everything (List of all transactions) select> 1 Something went wrong. <class 'TypeError'>: 'InstrumentedSet' object is not subscriptable File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/subcommands/loop.py", line 66, in main main.execute() File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/helpermenus.py", line 491, in execute return self._execute(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/helpermenus.py", line 512, in _execute self.items[item_i].execute() File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/helpermenus.py", line 491, in execute return self._execute(**kwargs) ^^^^^^^^^^^^^^^^^^^^^^^ File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/miscmenus.py", line 69, in _execute self.print_transactions(user, config["limits"]["user_recent_transaction_limit"]) File "/nix/store/32x6xrc1jrp0pz8riw6l7zgpj22xzi5s-dibbler-1.0.0/lib/python3.12/site-packages/dibbler/menus/miscmenus.py", line 86, in print_transactions for t in user.transactions[-1 : -limit - 1 : -1]: ```
oysteikt added the buggood first issuecrash report labels 2026-01-25 10:37:49 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Projects/dibbler#31