CTFd / ctfcli

ctfcli is a tool to manage Capture The Flag events and challenges
https://ctfd.io/
Apache License 2.0
174 stars 74 forks source link

Cannot create a point value of 0 #162

Open jimender2 opened 1 week ago

jimender2 commented 1 week ago

If I have a challenge that I want to have with a value of 0, I get an error saying 'Challenge does not provide a value'

I think this is the offending line and there should be an extra bit of logic to check if the value is 0 or not. Temp solved this by setting values = 1 for the challenges but I dont like that solution.

https://github.com/CTFd/ctfcli/blob/d8e08daedd6d22159f5978e1619b9d7073aa07f8/ctfcli/core/challenge.py#L660

kjcolley7 commented 5 days ago

Probably best to do something like if challenge.get("value", None) is None and ...