diff --git a/core/models/event.py b/core/models/event.py index 3cf5eabb5..0a98b2619 100644 --- a/core/models/event.py +++ b/core/models/event.py @@ -115,9 +115,7 @@ def ical_uid(self): def date_is_approximate(self): if not self.date: return True - if not all((self.date.year, self.date.month, self.date.day)): - return True - return False + return not all((self.date.year, self.date.month, self.date.day)) @property def lnglat(self): diff --git a/djangogirls/utils/sanitize.py b/djangogirls/utils/sanitize.py index 109629de7..ad6562116 100644 --- a/djangogirls/utils/sanitize.py +++ b/djangogirls/utils/sanitize.py @@ -11,9 +11,9 @@ def sanitize(value, output_type): """ # pylint: disable=no-else-return - if output_type == bool: + if output_type is bool: return sanitize_bool(value) - elif output_type == int: + elif output_type is int: return sanitize_int(value) # pylint: enable=no-else-return # unrecognised/unsupported output_type. just return what we got..