storiesofsolidarity / story-database

Database & API for Stories of Solidarity
https://app.storiesofsolidarity.org/admin/
GNU Affero General Public License v3.0
1 stars 1 forks source link

Possible defect for method 'expire_view_cache' #9

Open OshinoMoumou opened 3 years ago

OshinoMoumou commented 3 years ago

Greetings! I noticed that method expire_view_cache referred a StackOverflow post, while a recent comment to it mentioned that if the initial request are made in a different language / different timezone, the key won't match in the cache and you will end up with key = None. One other common issue is the request.META["SERVER_NAME"] being different (eg: 127.0.0.1:8000 vs localhost:80). I'm trying to learn the usefulness of such small updates on StackOverflow. Would this comment help improve your code? I understand that such defect might not happen in real life situation. In that case, do you think this comment can help prevent future bugs (for example, when the code were reused somewhere else)? I'll really appreciate it if you could kindly give me some feedback or suggestions. Thank you very much for your time. Have a nice day!