Eric Fischer
2018-05-02 10:03:50 -04:00
parent a1869d67f2
commit e18448e27d
79 changed files with 137 additions and 137 deletions

View File

@@ -728,7 +728,7 @@ class FieldDataCache(object):
"""
Add all `descriptors` to this FieldDataCache.
"""
if self.user.is_authenticated():
if self.user.is_authenticated:
self.scorable_locations.update(desc.location for desc in descriptors if desc.has_score)
for scope, fields in self._fields_to_cache(descriptors).items():
if scope not in self.cache:
@@ -815,7 +815,7 @@ class FieldDataCache(object):
Raises: KeyError if key isn't found in the cache
"""
if key.scope.user == UserScope.ONE and not self.user.is_anonymous():
if key.scope.user == UserScope.ONE and not self.user.is_anonymous:
# If we're getting user data, we expect that the key matches the
# user we were constructed for.
assert key.user_id == self.user.id
@@ -842,7 +842,7 @@ class FieldDataCache(object):
by_scope = defaultdict(dict)
for key, value in kv_dict.iteritems():
if key.scope.user == UserScope.ONE and not self.user.is_anonymous():
if key.scope.user == UserScope.ONE and not self.user.is_anonymous:
# If we're getting user data, we expect that the key matches the
# user we were constructed for.
assert key.user_id == self.user.id
@@ -875,7 +875,7 @@ class FieldDataCache(object):
if self.read_only:
return
if key.scope.user == UserScope.ONE and not self.user.is_anonymous():
if key.scope.user == UserScope.ONE and not self.user.is_anonymous:
# If we're getting user data, we expect that the key matches the
# user we were constructed for.
assert key.user_id == self.user.id
@@ -896,7 +896,7 @@ class FieldDataCache(object):
Returns: bool
"""
if key.scope.user == UserScope.ONE and not self.user.is_anonymous():
if key.scope.user == UserScope.ONE and not self.user.is_anonymous:
# If we're getting user data, we expect that the key matches the
# user we were constructed for.
assert key.user_id == self.user.id
@@ -916,7 +916,7 @@ class FieldDataCache(object):
Returns: datetime if there was a modified date, or None otherwise
"""
if key.scope.user == UserScope.ONE and not self.user.is_anonymous():
if key.scope.user == UserScope.ONE and not self.user.is_anonymous:
# If we're getting user data, we expect that the key matches the
# user we were constructed for.
assert key.user_id == self.user.id