fix: mock-forgejo path parsing bug + non-fatal cron in smoke-init (#586)
- Fix off-by-one in mock admin/users/{username}/repos path extraction
(parts[4] was 'users', not the username — should be parts[5])
- Change _install_cron_impl to return 1 instead of exit 1 when crontab
is missing, so cron failure doesn't abort entire init
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d190296af1
commit
3405879d8b
3 changed files with 5 additions and 34 deletions
|
|
@ -505,8 +505,9 @@ class ForgejoHandler(BaseHTTPRequestHandler):
|
|||
require_token(self)
|
||||
|
||||
parts = self.path.split("/")
|
||||
if len(parts) >= 6:
|
||||
target_user = parts[4]
|
||||
# /api/v1/admin/users/{username}/repos → parts[5] is the username
|
||||
if len(parts) >= 7:
|
||||
target_user = parts[5]
|
||||
else:
|
||||
json_response(self, 400, {"message": "username required"})
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue