Flip value and initial for dynamic challenges to better support ctfcli (#1921)

* Makes the initial value for a dynamic challenge provided by the `initial` argument instead of the `value` argument. This makes it easier to support ctfcli. Refer to https://github.com/CTFd/ctfcli/issues/13. 
* Closes #1875
This commit is contained in:
Kevin Chung
2021-06-18 19:13:55 -04:00
committed by GitHub
parent 614f086540
commit df27d0e7a9
4 changed files with 11 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ def test_can_create_dynamic_challenge():
"name": "name",
"category": "category",
"description": "description",
"value": 100,
"initial": 100,
"decay": 20,
"minimum": 1,
"state": "hidden",
@@ -54,7 +54,7 @@ def test_can_update_dynamic_challenge():
"name": "name",
"category": "category",
"description": "description",
"value": 100,
"initial": 100,
"decay": 20,
"minimum": 1,
"state": "hidden",
@@ -102,7 +102,7 @@ def test_can_add_requirement_dynamic_challenge():
"name": "name",
"category": "category",
"description": "description",
"value": 100,
"initial": 100,
"decay": 20,
"minimum": 1,
"state": "hidden",
@@ -160,7 +160,7 @@ def test_can_delete_dynamic_challenge():
"name": "name",
"category": "category",
"description": "description",
"value": 100,
"initial": 100,
"decay": 20,
"minimum": 1,
"state": "hidden",
@@ -191,7 +191,7 @@ def test_dynamic_challenge_loses_value_properly():
"name": "name",
"category": "category",
"description": "description",
"value": 100,
"initial": 100,
"decay": 20,
"minimum": 1,
"state": "visible",
@@ -240,7 +240,7 @@ def test_dynamic_challenge_doesnt_lose_value_on_update():
"name": "name",
"category": "category",
"description": "description",
"value": 10000,
"initial": 10000,
"decay": 4,
"minimum": 10,
"state": "visible",
@@ -273,7 +273,7 @@ def test_dynamic_challenge_value_isnt_affected_by_hidden_users():
"name": "name",
"category": "category",
"description": "description",
"value": 100,
"initial": 100,
"decay": 20,
"minimum": 1,
"state": "visible",
@@ -330,7 +330,7 @@ def test_dynamic_challenges_reset():
"name": "name",
"category": "category",
"description": "description",
"value": 100,
"initial": 100,
"decay": 20,
"minimum": 1,
"state": "hidden",