forked from 42CTF/website
fixed latest flags when chall is disabled + fixed recompute_scoreboard
This commit is contained in:
parent
0fbf7b77c3
commit
e806b23812
|
@ -52,7 +52,7 @@ def home(request):
|
|||
top10 = UserProfileInfo.objects.select_related().order_by('-score', 'last_submission_date', 'user__username')[:10]
|
||||
nb_flags = CTF_flags.objects.count()
|
||||
nb_users = UserProfileInfo.objects.count()
|
||||
latest_flags = CTF_flags.objects.order_by('-flag_date')[:5]
|
||||
latest_flags = CTF_flags.objects.filter(ctf__event = None, ctf__disabled=False).order_by('-flag_date')[:5]
|
||||
top_weekly = get_weekly_top()
|
||||
|
||||
return render(request, 'home/home.html', {'news' : news, 'ctfs' : latest_ctfs, 'top' : top10, 'flags' : nb_flags,
|
||||
|
|
|
@ -19,8 +19,6 @@ class Command(BaseCommand):
|
|||
u.score = 0
|
||||
u.save()
|
||||
|
||||
li = [(s, u) for (u, s) in scores.items()]
|
||||
|
||||
for (u, s) in li:
|
||||
u.userprofileinfo.score = s
|
||||
for u in scores:
|
||||
u.userprofileinfo.score = scores[u]
|
||||
u.userprofileinfo.save()
|
||||
|
|
Loading…
Reference in New Issue