[fix] Guard admin reverse and template url behind FIRMWARE_UPGRADER_API #444#447
[fix] Guard admin reverse and template url behind FIRMWARE_UPGRADER_API #444#447BHARATH0153 wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughThis PR fixes a bug where the admin pages unconditionally reverse the Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Suggested reviewers
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai any outstanding issues? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Get PR details, review comments, and checks
gh pr view 447 --repo openwisp/openwisp-firmware-upgrader --json title,state,reviews,reviewDecision,statusCheckRollup
echo "=== PR REVIEW COMMENTS ==="
gh api repos/openwisp/openwisp-firmware-upgrader/pulls/447/comments --jq '.[] | {user: .user.login, body: .body, path: .path, line: .line, resolved: .pull_request_review_id}'
echo "=== PR ISSUE COMMENTS ==="
gh api repos/openwisp/openwisp-firmware-upgrader/issues/447/comments --jq '.[] | {user: .user.login, body: .body[0:300]}'
echo "=== PR FILES ==="
gh api repos/openwisp/openwisp-firmware-upgrader/pulls/447/files --jq '.[] | {filename: .filename, additions: .additions, deletions: .deletions}'Length of output: 7009 🏁 Script executed: #!/bin/bash
# Look at the actual diff to check for issues
gh api repos/openwisp/openwisp-firmware-upgrader/pulls/447 --jq '.body'Length of output: 892 🏁 Script executed: #!/bin/bash
# Get the changed files content
echo "=== admin.py patch ==="
gh api repos/openwisp/openwisp-firmware-upgrader/pulls/447/files --jq '.[] | select(.filename | contains("admin")) | .patch'
echo "=== template patch ==="
gh api repos/openwisp/openwisp-firmware-upgrader/pulls/447/files --jq '.[] | select(.filename | contains("template") or contains("html")) | .patch'Length of output: 2364
✅ Good newsAll CI checks pass across all Python/Django matrix combinations, and there are no unresolved review comments.
|
Checklist
Reference to Existing Issue
Closes #444
Changes
Guard the
reverse("upgrader:api_upgradeoperation_cancel")call in the admin and the{% url %}tag in the template behindFIRMWARE_UPGRADER_API. When the API is disabled, the URL doesn't exist and these causeNoReverseMatch— now they gracefully return empty string instead of crashing.