remove restriction when using open api

This commit is contained in:
zema1
2018-12-16 10:30:19 +08:00
parent 745dba8cad
commit 03c68419b0
5 changed files with 9 additions and 5 deletions

View File

@@ -57,7 +57,7 @@ class ContestAPI(APIView):
for ip_range in data["allowed_ip_ranges"]:
try:
ip_network(ip_range, strict=False)
except ValueError as e:
except ValueError:
return self.error(f"{ip_range} is not a valid cidr network")
if not contest.real_time_rank and data.get("real_time_rank"):
cache_key = f"{CacheKey.contest_rank_cache}:{contest.id}"