— Yes but it's giving error after this
i.e local variable last_count referenced before assignment
— Yeah, I get it. You have to make the field last_count as global variable
— Https://pastebin.com/FiuK3NSM
Updated here
— Traceback error is coming after clicking the button
— Error like TypeError:'NoneType' object is not subscriptable
— It is happening only in tst working fine in prod
— Try:
...
except NoneType:
pass
— Working now thanks once again