Auto-navigate to new organization after creation

Open Beginner friendly
#6,548 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start in app/main/organizations.py at add_organization and read the existing create flow; then review the related harvest-source change in #6418. Update the integration coverage in tests/integration/app/test_forms.py and the Playwright create/destroy flow. Done means successful creation opens the new organization page with the confirmation and any conflict warning, while save failures return to the form with the error.

Written by the indexing model from the issue text.

Description

Harvester

User Story

In order to verify a new organization and start adding harvest sources to it, a harvest admin wants to land on the new organization's page after creating it.

Acceptance Criteria

  • GIVEN I am logged in to the harvest admin
    WHEN I submit the Add Organization form successfully
    THEN I am taken to the new organization's page (/organization/<id>)
    AND the "Added new organization" message shows on that page
  • GIVEN the new organization has both a repository URL and an exemption flag
    WHEN I submit the form
    THEN the conflict warning also shows on the new organization's page
  • GIVEN the organization fails to save
    WHEN I submit the form
    THEN I stay on the add form with the error message

Background

  • Today a successful create redirects to the organization list (app/main/organizations.py, add_organization), so the user has to find the new org in the list.
  • Same change made for harvest sources in #6418 (harvester PR GSA/datagov-harvester#1050).

Security Considerations (required)

None. Redirect target is built from the new org's ID with url_for, not from user input.

Sketch

  • Change the success redirect in add_organization to url_for("main.view_organization", org_identifier=org.id)
  • Redirect failures back to the add form instead of the list
  • Update integration tests in tests/integration/app/test_forms.py and the Playwright create/destroy flow
Dominant language
Python
Stars
1.2k
Forks
207
Avg merge
3d 16h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from GSA/data.gov

All issues in GSA/data.gov

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.