Clear cache on finished_submission; #463

This commit is contained in:
Tudor 2016-09-14 18:42:12 -04:00
parent b44bc84b5a
commit 3804be0730

View File

@ -2,8 +2,9 @@ from django.core.cache import cache
def finished_submission(sub):
keys = ['user_complete:%d' % sub.user_id]
keys = ['user_complete:%d' % sub.user_id, 'user_attempted:%s' % sub.user_id]
if hasattr(sub, 'contest'):
participation = sub.contest.participation
keys += ['contest_complete:%d' % participation.id]
keys += ['contest_attempted:%d' % participation.id]
cache.delete_many(keys)