Skip to content

Commit

Permalink
set a cutoff date after which belts become cumulative (currently 2023…
Browse files Browse the repository at this point in the history
….10.1)
  • Loading branch information
zardus committed Jan 13, 2024
1 parent 2c44578 commit 7b816e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dojo_plugin/utils/belts.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import datetime

from CTFd.cache import cache
from flask import url_for
from ..models import Dojos


CUMULATIVE_CUTOFF = datetime.datetime(2023, 10, 1)
BELT_REQUIREMENTS = {
"orange": "intro-to-cybersecurity",
"yellow": "program-security",
Expand Down Expand Up @@ -41,7 +44,7 @@ def get_belts():
result["ranks"][color] = []

for user,date in dojo.completions():
if result["users"].get(user.id, {"rank_id":-1})["rank_id"] != n-1:
if date > CUMULATIVE_CUTOFF and result["users"].get(user.id, {"rank_id":-1})["rank_id"] != n-1:
continue
result["dates"][color][user.id] = str(date)
result["users"][user.id] = {
Expand Down

0 comments on commit 7b816e7

Please sign in to comment.