-
Notifications
You must be signed in to change notification settings - Fork 24
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
Column: TableTN #61 #78
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are more changes that expected.
The only required change was
if not bcrypt.verify(admin_password, ADMIN_HASH):
response.status_code = 401
also ADMIN_HASH
is a constant defined in admin.py
, you need to import it into team.py
before using it.
src/pwncore/routes/team.py
Outdated
response.status_code = 401 | ||
return {"msg_code": "not_authorized"} | ||
|
||
team = await Team.get_or_none(id=id) | ||
if not team: | ||
response.status_code = 404 | ||
return {"msg_code": "team_not_found"} | ||
|
||
try: | ||
team.table_tn = data.table_tn | ||
await team.save() | ||
except Exception: | ||
response.status_code = 500 | ||
return {"msg_code": "db_error"} | ||
|
||
return {"msg_code": "tabletn_upserted"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines were NOT meant to be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
feat: Add teamTN API endpoint
-Added table_tn (optional integer) column to the Team model.
-Implemented POST /team/{id} admin route to upsert the table_tn value.
-Included input validation (TableTNBody model) for the new API endpoint.
-Added bcrypt hashing for secure password storage
-Updated API endpoints to require
admin_password
-Ensured compatibility with existing team logic
Closes #61