diff options
author | Magnus Hagander | 2018-12-15 10:05:34 +0000 |
---|---|---|
committer | Magnus Hagander | 2018-12-15 10:05:34 +0000 |
commit | d3cbef33ecc739a7fea78ab21ea097178c204f91 (patch) | |
tree | b56248a4d520e13197491b53eb0b3feec2d0e3b6 /postgresqleu/util/middleware.py | |
parent | f01500dcf70022e2d23b91c147a6254ac8c4e3b2 (diff) |
Replace usage of has_key()
It has been deprecated, and instead we should use "in" and "not in", so
make that change across the board.
Diffstat (limited to 'postgresqleu/util/middleware.py')
-rw-r--r-- | postgresqleu/util/middleware.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/postgresqleu/util/middleware.py b/postgresqleu/util/middleware.py index 778118f8..becb90c6 100644 --- a/postgresqleu/util/middleware.py +++ b/postgresqleu/util/middleware.py @@ -11,7 +11,7 @@ class FilterPersistMiddleware(object): path = request.path if path.find('/admin/') != -1: # Dont waste time if we are not in admin query_string = request.META['QUERY_STRING'] - if not request.META.has_key('HTTP_REFERER'): + if 'HTTP_REFERER' not in request.META: return None session = request.session @@ -31,7 +31,7 @@ class FilterPersistMiddleware(object): request.session[key] = query_string elif '_directlink=1' in query_string: # Direct link to a filter, by ourselves, so remove it redirect_to = path + '?' + query_string.replace('&_directlink=1', '') - if session.has_key(key): + if key in session: del session[key] return http.HttpResponseRedirect(redirect_to) else: # We are are coming from another page, restore filter if available |