ISKME/OER-Commons — comment on commit 55de602b5e14e2eb686f314346aadc806dd201f4
File:  line 0
By andreyfedoseev:

I don't like the logic here. It can be simplified to something like that:

visited = json.loads(request.COOKIE.get("visits", "{}")) # we need to handle JSON parsing exception here

if object_id not in visited.get(content_type_id, []):
# count item here
# update cookie value