Make visitor tracking more robust
This commit is contained in:
parent
4374325eb3
commit
023d5f91df
|
@ -37,6 +37,8 @@ def track_visit(request, session):
|
||||||
db = dict(hits=0)
|
db = dict(hits=0)
|
||||||
if JsonDB.exists(dbfile):
|
if JsonDB.exists(dbfile):
|
||||||
db = JsonDB.get(dbfile)
|
db = JsonDB.get(dbfile)
|
||||||
|
if db is None:
|
||||||
|
db = dict(hits=0)
|
||||||
|
|
||||||
# Update it?
|
# Update it?
|
||||||
if not cookie:
|
if not cookie:
|
||||||
|
@ -50,6 +52,8 @@ def track_visit(request, session):
|
||||||
db = dict()
|
db = dict()
|
||||||
if JsonDB.exists(dbfile):
|
if JsonDB.exists(dbfile):
|
||||||
db = JsonDB.get(dbfile)
|
db = JsonDB.get(dbfile)
|
||||||
|
if db is None:
|
||||||
|
db = dict()
|
||||||
|
|
||||||
# Update with their IP?
|
# Update with their IP?
|
||||||
if not cookie and not addr in db:
|
if not cookie and not addr in db:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user