Add annotations to avatar.py, db.py, logging_util.py, unminify.py.

Also, fixed a a small type annotation in users.py because email must
be a string because emails don't support UTF-8 at this time (according
a comment in gravatar_hash in avatar.py).
This commit is contained in:
Max
2016-06-04 19:20:00 -07:00
committed by Tim Abbott
parent 2855c285b4
commit 86fb6467e7
5 changed files with 32 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
# type: (logging.LogRecord) -> bool
from django.conf import settings
from django.core.cache import cache
@@ -44,9 +45,11 @@ class EmailLimiter(_RateLimitFilter):
class ReturnTrue(logging.Filter):
def filter(self, record):
# type: (logging.LogRecord) -> bool
return True
class RequireReallyDeployed(logging.Filter):
def filter(self, record):
# type: (logging.LogRecord) -> bool
from django.conf import settings
return settings.PRODUCTION