Admin changes rebased#411
Conversation
Add @requires_admin decorator Add clarity to backend start error status Signed-off-by: Ulincsys <ulincsys@gmail.com>
- Add ssl decorator to config endpoints - Fix syntax error in admin_required decorator - Update dashboard endpoint to use config class directly - Update dashboard styles with more consistent colors - Implement config update functionality in admin dashboard Signed-off-by: Ulincsys <28362836a@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
Signed-off-by: Ulincsys <ulincsys@gmail.com>
This reverts commit 01f93ef. Signed-off-by: Adrian Edwards <adredwar@redhat.com>
| import beaker | ||
|
|
||
| from flask import request, jsonify, current_app | ||
| from flask import request, jsonify, current_app, abort |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused current_app imported from flask (unused-import)
| @@ -38,6 +40,13 @@ def unsupported_method(error): | |||
|
|
|||
| return render_message("405 - Method not supported", "The resource you are trying to access does not support the request method used"), 405 | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_message' (undefined-variable)
|
|
||
| @app.errorhandler(403) | ||
| def forbidden(error): | ||
| if AUGUR_API_VERSION in str(request.url_rule): |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'AUGUR_API_VERSION' (undefined-variable)
| if AUGUR_API_VERSION in str(request.url_rule): | ||
| return jsonify({"status": "Forbidden"}), 403 | ||
|
|
||
| return render_message("403 - Forbidden", "You do not have permission to view this page"), 403 |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_message' (undefined-variable)
| raise e | ||
|
|
||
| return render_message("500 - Internal Server Error", "An error occurred while trying to service your request. Please try again, and if the issue persists, please file a GitHub issue with the below error message:", error=stacktrace), 500 | ||
| return render_message("500 - Internal Server Error", """An error occurred while trying to service your request. |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_message' (undefined-variable)
| from .init import logger | ||
| from .url_converters import * | ||
|
|
||
| from functools import wraps |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused wraps imported from functools (unused-import)
| @@ -318,6 +325,7 @@ def user_group_view(group = None): | |||
| return render_module("user-group-repos-table", title="Repos", repos=data, query_key=query, activePage=params["page"], pages=page_count, offset=pagination_offset, PS="user_group_view", reverse = rev, sorting = params.get("sort"), group=group) | |||
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'render_module' (undefined-variable)
| backend_config = requestJson("config/get", False) | ||
| backend_config = AugurConfig(logger, db_session).load_config() | ||
|
|
||
| with get_session() as session: |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0621: Redefining name 'session' from outer scope (line 8) (redefined-outer-name)
| ] | ||
|
|
||
| backend_config = requestJson("config/get", False) | ||
| backend_config = AugurConfig(logger, db_session).load_config() |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
E0602: Undefined variable 'AugurConfig' (undefined-variable)
| from .server import LoginException | ||
| from collectoss.application.util import * | ||
| from collectoss.application.db.lib import get_value | ||
| from collectoss.application.config import SystemConfig |
There was a problem hiding this comment.
[pylint] reported by reviewdog 🐶
W0611: Unused SystemConfig imported from collectoss.application.config (unused-import)
Signed-off-by: Adrian Edwards <adredwar@redhat.com>
Description
This is a branch containing some work that was done on an admin page. This work began before my time, was at some point merged, and then (presumably by accident due to the lack of one-way code flow back then) was somehow un-merged.
This has been rebased to the current version and needs extensive testing to ensure that it works
Notes for Reviewers
needs EXTENSIVE testing. draft because i have no clue when ill get to this
Signed commits
Generative AI disclosure
Please select one option:
If AI tools were used, please provide details below:
No AI tools used for development to my knowledge. these changes are largely from 2024 or before so i doubt genAI was that good at coding back then