Skip to content
This repository has been archived by the owner on Feb 14, 2024. It is now read-only.

Stakeholder Bulk Upload. UPDATE: Move to Django #271

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

aloftus23
Copy link
Contributor

@aloftus23 aloftus23 commented Sep 21, 2022

fixes #237

🗣 Description

Adds a page to the Flask UI that allows internal users to upload a CSV of stakeholders, which is then parsed and integrated into the P&E infrastructure (database and data sources).

UPDATE: Originally written for Flask, but needs to be changed to fit Django

💭 Motivation and context

P&E is going to start adding much more stakeholders at once so this improves automation.

🧪 Testing

Passes pre-commits and py-tests.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

@aloftus23 aloftus23 self-assigned this Sep 21, 2022
# Check if the post request has the file part
if "file" not in request.files:
flash("No file part", "warning")
return redirect(request.url)

Check warning

Code scanning / CodeQL

URL redirection from remote source

Untrusted URL redirection due to [A user-provided value](1). Untrusted URL redirection due to [A user-provided value](2). Untrusted URL redirection due to [A user-provided value](3).
# empty file without a filename.
if file.filename == "":
flash("No selected file", "warning")
return redirect(request.url)

Check warning

Code scanning / CodeQL

URL redirection from remote source

Untrusted URL redirection due to [A user-provided value](1). Untrusted URL redirection due to [A user-provided value](2). Untrusted URL redirection due to [A user-provided value](3). Untrusted URL redirection due to [A user-provided value](4).
@lgtm-com
Copy link

lgtm-com bot commented Sep 21, 2022

This pull request introduces 4 alerts when merging fbebd0d into 78ccbfd - view on LGTM.com

new alerts:

  • 2 for URL redirection from remote source
  • 1 for Unreachable 'except' block
  • 1 for Variable defined multiple times

@cduhn17 cduhn17 added the High Priority Issue is key to completion of Sprint label Oct 18, 2022
@aloftus23 aloftus23 added Draft PR PR in draft mode, not passing checks Production ready Code passing checks, internal code review done, merged into staging environment and remove draft PR labels Oct 23, 2022
@aloftus23 aloftus23 removed Draft PR PR in draft mode, not passing checks Production ready Code passing checks, internal code review done, merged into staging environment and remove draft PR labels Dec 21, 2022
@aloftus23
Copy link
Contributor Author

Removing "Draft PR" and "Production ready" tags since this needs to be updated to fit the Django framework.

@aloftus23 aloftus23 changed the title Stakeholder Bulk Upload into Flask UI Stakeholder Bulk Upload. UPDATE: Move to Django Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
High Priority Issue is key to completion of Sprint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bulk stakeholder upload in Django
2 participants