Commit 6bd356e1 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

Avoid negative indexing, not supported by django lists

parent 3fc14d9b
......@@ -244,7 +244,10 @@ def argmap_check(obj):
if hasattr(obj, 'keys') and callable(obj.keys):
# this could cover both cases
return ARGMAP_MAGIC in obj
return hasattr(obj, '__len__') and len(obj) and obj[-1] == ARGMAP_MAGIC
if hasattr(obj, '__len__'):
length = len(obj)
return length and obj[length-1] == ARGMAP_MAGIC
return False
def argmap_unzip_dict(argmap):
if not hasattr(argmap, 'keys'):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment