-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BRING BACK THE BELTS #283
BRING BACK THE BELTS #283
Conversation
One caveat here: because this uses the live, latest requirements, a lot of people who have previously earned belts have been de-belted. Not super sure how to handle this without a separate belts table. |
Shall we use ctfd awards to handle belts from prior requirements? We can grant BELT_YELLOW, BELT_BLUE, etc awards (and also use this for emoji). That'll also be easy to work into the various belt checker functions. |
e53e8d8
to
afc92f7
Compare
Shouldn’t we have a belts table? What’s the criteria for having a belt then if it can be taken away when new content is added? |
Yeah, I think we should use CTFd Awards (https://github.com/CTFd/CTFd/blob/master/CTFd/models/__init__.py#L213). We can make
We can best effort retroactively assign null category / best effort date for prior belts. Also, make sure you don't make emails just suddenly go public. |
for now, i'm going to approximate this by just having a cutoff date after which belts become cumulative (and before which they are not). Right now, that's going to be October 10, 2023. We can implement the awards-based model next :-) |
OKAY! Provided tests pass, this is ready to go. In summary:
@robwaz one caveat is that I moved your get_user_belts function to |
Okay, we also fetch belts out of the awards table now. @ConnorNelson @robwaz could you guys create relevantly-dated awards for people that need them? Right now, Award-derived belts are explicitly non-cumulative, but we might just want to handle them via the normal date cutoff for cumulativeness or something. Anyways, this code will allow us to make the belts page accurate (just someone has to do the DB footwork). |
Also, I'm all subclassing Awards and such (as long as someone else does it); just didn't feel like figuring it out with sqlalchemy |
To create the belt entries for all the users who meet the live dojo requirements:
|
The deployment process should be:
|
Other related TODOs:
|
TIME TO YOLO |
For the record, the script to create belt roles from the discord data:
|
And the script to create belt roles from challenge completion data:
|
Wiping the bad discord dates:
|
Importing belt data (including dates) from the legacy belts page:
|
Using last-solve time for still-missing Green and Yellow belts (blue is harder because of how it's changed):
|
The last recovered dates, from manual sleuthing (mostly discord).
Currently trying to get this to actually apply, but it's hanging on the first update for some reason. |
Okay, we have two yellow belt awards without dates remaining:
Both of these hackers have blue belts now, so I'm not going to worry about it. |
And some code to port over belts for users that match from the V1 database:
|
BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS BELTS (on the scoreboard)