From 80b4c6a277e9bec22195aac9ef54d664af7624b5 Mon Sep 17 00:00:00 2001 From: Nathan Kim Date: Sun, 14 Jan 2024 20:52:17 -0500 Subject: [PATCH 1/3] Allow tours to have attachments by default --- backend/siarnaq/bracket/challonge.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/siarnaq/bracket/challonge.py b/backend/siarnaq/bracket/challonge.py index 2c81b6e74..253a7a6a5 100644 --- a/backend/siarnaq/bracket/challonge.py +++ b/backend/siarnaq/bracket/challonge.py @@ -59,6 +59,7 @@ def create_tournament(tournament: Tournament, *, is_private: bool): "tournament_type": challonge_type, "private": is_private, "url": challonge_id, + "match_options": {"accept_attachments": True}, }, } } From 0f414b2a883695d22c5e40309a5a2887421cd1d6 Mon Sep 17 00:00:00 2001 From: Nathan Kim Date: Sun, 14 Jan 2024 20:58:06 -0500 Subject: [PATCH 2/3] Add game name to Challonge, cuz it's required from the Settings page --- backend/siarnaq/bracket/challonge.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/siarnaq/bracket/challonge.py b/backend/siarnaq/bracket/challonge.py index 253a7a6a5..0083e5135 100644 --- a/backend/siarnaq/bracket/challonge.py +++ b/backend/siarnaq/bracket/challonge.py @@ -59,6 +59,7 @@ def create_tournament(tournament: Tournament, *, is_private: bool): "tournament_type": challonge_type, "private": is_private, "url": challonge_id, + "game_name": "Battlecode", "match_options": {"accept_attachments": True}, }, } From c7f4518485baf57c9fb0b53d7d983a7e95388aab Mon Sep 17 00:00:00 2001 From: Nathan Kim Date: Mon, 15 Jan 2024 12:33:17 -0500 Subject: [PATCH 3/3] Extra info for local dev --- backend/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/README.md b/backend/README.md index e0bfa8b91..1ed90a9a4 100644 --- a/backend/README.md +++ b/backend/README.md @@ -11,8 +11,8 @@ is the backend of Siarnaq, written in Django. `db.sqlite3`, which contains a toy database for testing. You should not commit this. 1. Run `./manage.py runserver` to turn on the server! -While developing, you may find the `api/specs/swagger-ui` endpoint userful for viewing -and querying the avaiable API. +While developing, you may find the `api/specs/swagger-ui` endpoint useful for viewing +and querying the available API. To authenticate to use this, log into some page that would use the same environment (such as the frontend homepage or admin page in the same environment), then refresh the page. Get the value of the `access` cookie used in the _header_ of the HTTP request (usually in the dev tools or network tab). Copy it, making sure not to include any spaces or punctuation from the beginning or end. Then on the `swagger-ui` endpoint, click `Authenticate` at the top, and enter the copied value there. If you ever get your database into a really broken state, just delete `db.sqlite3`, and start again.