Perform is None check before detailed type checks.

This commit is contained in:
voussoir 2019-04-01 23:17:35 -07:00
parent 3aa064cde3
commit 68a567d266

View file

@ -1103,9 +1103,9 @@ class PDBUtilMixin:
return new_photo_kwargs return new_photo_kwargs
def _normalize_new_photo_ratelimit(new_photo_ratelimit): def _normalize_new_photo_ratelimit(new_photo_ratelimit):
if isinstance(new_photo_ratelimit, ratelimiter.Ratelimiter): if new_photo_ratelimit is None:
pass pass
elif new_photo_ratelimit is None: elif isinstance(new_photo_ratelimit, ratelimiter.Ratelimiter):
pass pass
elif isinstance(new_photo_ratelimit, (int, float)): elif isinstance(new_photo_ratelimit, (int, float)):
new_photo_ratelimit = ratelimiter.Ratelimiter(allowance=1, period=new_photo_ratelimit) new_photo_ratelimit = ratelimiter.Ratelimiter(allowance=1, period=new_photo_ratelimit)