Skip to content

Commit

Permalink
Filter nonstandard contests from ;mashup
Browse files Browse the repository at this point in the history
  • Loading branch information
krofna committed Aug 1, 2019
1 parent 85b3b88 commit 05031af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tle/cogs/codeforces.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ async def mashup(self, ctx, *handles: str):
rating = int(round(sum(user.rating or 1500 for user in info) / len(handles), -2))
problems = [prob for prob in cf_common.cache2.problem_cache.problems
if abs(prob.rating - rating) <= 100 and prob.name not in solved
and not any(cf_common.is_contest_writer(prob.contestId, handle) for handle in handles)]
and not any(cf_common.is_contest_writer(prob.contestId, handle) for handle in handles)
and not cf_common.is_nonstandard_contest(cf_common.cache2.contest_cache.get_contest(prob.contestId))]

if len(problems) < 4:
await ctx.send('Problems not found within the search parameters')
Expand Down

0 comments on commit 05031af

Please sign in to comment.