account_picture_get_count.py (378B)
1 import importlib 2 keys = importlib.import_module("fedcm.support.keys") 3 4 def main(request, response): 5 account_picture_url = "/fedcm/support/account_picture.py" 6 7 counter = request.server.stash.take(keys.ACCOUNT_PICTURE_COUNTER_KEY, account_picture_url) 8 try: 9 counter = counter.decode() 10 except (UnicodeDecodeError, AttributeError): 11 counter = 0 12 13 return str(counter)