Negative values were broken due to some missing code. Fix it by adding
code based on an example from one of the other models.
Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Stephen Finucane <stephenfinucane@hotmail.com>
if max_count > 0:
return list(map(check_to_dict, checks[:max_count]))
+ elif max_count < 0:
+ min_count = checks.count() + max_count
+ return list(map(check_to_dict, checks[min_count:]))
else:
return list(map(check_to_dict, checks))
except Check.DoesNotExist: