aboutsummaryrefslogtreecommitdiff
path: root/gn2/wqflask/edit.py
AgeCommit message (Collapse)Author
2024-03-26Add missing docstrings to save/metadata_edit functions.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add a final fallback for match expression.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Use "require_oauth2_edit_resource_access" for edit/save endpoints.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Replace "__" prefix for with "_".Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Auto-pep8 (using flake8) file.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Replace "login_required" with "require_oauth2".Munyoki Kilyungi
* gn2/wqflask/edit.py: Replace "login_required" import with "require_oauth2". (metadata_edit): Replace "login_required" with "require_oauth2". (edit): Ditto. (save): Ditto. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Reset repo and pull then write changes before committing.Munyoki Kilyungi
* gn2/wqflask/edit.py: Import session_info. (save_dataset_metadata): Add author as an argument. Reset repo and pull then write changes before committing. Split strings before __run_cmd is called. (metadata_edit): Rename "metadata" -> "__metadata". (save): Save the output to the correct path. Pass author to "save_dataset_metadata". Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Prevent shell injection by disabling shell invocation in subprocess.Munyoki Kilyungi
See: <https://stackoverflow.com/questions/52019920/python3-sanitizing-user-input-passed-to-shell-as-parameter> for more information. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Replace Path construct with a format string.Munyoki Kilyungi
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add missing "curry" to __run_cmd.Munyoki Kilyungi
This is required to be able to pass __run_cmd through a pipeline. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Replace Path.join with urljoin for url paths.Munyoki Kilyungi
* gn2/wqflask/edit.py: Import urljoin. (metadata_edit): Replace Path with urljoin. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Make GN3_LOCAL_URL local to avoid circular imports.Munyoki Kilyungi
* gn2/wqflask/edit.py: Move GN3_LOCAL_URL ... (metadata_edit): ... here. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Add function for saving metadata in git.Munyoki Kilyungi
* gn2/wqflask/edit.py (save_dataset_metadata): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
2024-03-26Integrate CKEditor into metadata editing.Munyoki Kilyungi
* gn2/wqflask/__init__.py: Register blueprint endpoint for metadata edits. * gn2/wqflask/edit.py (metadata_edit): New function. (save): Ditto. * gn2/wqflask/templates/metadata/dataset.html: New template. * gn2/wqflask/templates/metadata/editor.html: New template. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>