From 3d5b37cef23b37768e90ada93cf38ff39649316f Mon Sep 17 00:00:00 2001 From: Matt Wright Date: Tue, 6 May 2014 13:14:25 -0400 Subject: [PATCH] Polish for static analysis --- flask_security/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flask_security/core.py b/flask_security/core.py index b719d13..e6341e2 100644 --- a/flask_security/core.py +++ b/flask_security/core.py @@ -295,6 +295,9 @@ class RoleMixin(object): def __ne__(self, other): return not self.__eq__(other) + def __hash__(self): + return hash(self.name) + class UserMixin(BaseUserMixin): """Mixin for `User` model definitions""" @@ -340,7 +343,7 @@ class _SecurityState(object): fn not in group and group.append(fn) def _run_ctx_processor(self, endpoint): - rv, fns = {}, [] + rv = {} for g in [None, endpoint]: for fn in self._context_processors.setdefault(g, []): rv.update(fn())