Closed jarromie closed 6 months ago
Fixed
this needs an else:
else:
method = None
drug_and_method = drug_name
otherwise you get this:
File "/opt/bitbot/modules/tripsit.py", line 187, in redose
[drug_name, dose, method, utils.datetime.format.iso8601(now), onset])
UnboundLocalError: local variable 'method' referenced before assignment
https://github.com/jesopo/bitbot-modules/blob/e1f6cd74e99ba54bf05a0e01daac907122ee172e/tripsit.py#L179-L182
should be replaced with
old settings in the db will have no index 4 in their idose, thus your code would cause an index error