forked from 42CTF/website
hotfix for dynamic scoring
This commit is contained in:
parent
f8eef0ef3d
commit
aadb2ac858
|
@ -15,7 +15,7 @@ class Command(BaseCommand):
|
||||||
nb_solves = len(solves)
|
nb_solves = len(solves)
|
||||||
|
|
||||||
if nb_solves > 0:
|
if nb_solves > 0:
|
||||||
new_points = 200 - int(log(nb_solves)*8.5)*5
|
new_points = max(200 - int(log(nb_solves)*8.5)*5, 5)
|
||||||
else:
|
else:
|
||||||
new_points = 200
|
new_points = 200
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ def actualize_points(ctf):
|
||||||
solves = CTF_flags.objects.filter(ctf=ctf)
|
solves = CTF_flags.objects.filter(ctf=ctf)
|
||||||
nb_solves = len(solves)
|
nb_solves = len(solves)
|
||||||
|
|
||||||
new_points = 200 - int(log(nb_solves)*8.5)*5
|
new_points = max(200 - int(log(nb_solves)*8.5)*5, 5)
|
||||||
|
|
||||||
if new_points != ctf.points:
|
if new_points != ctf.points:
|
||||||
diff = ctf.points - new_points
|
diff = ctf.points - new_points
|
||||||
|
|
Loading…
Reference in New Issue