Skip to content

Conversation

@kabir2123
Copy link

@kabir2123 kabir2123 commented Oct 30, 2025

Fix: ensure redirect to user group view includes required group path param and validate inputs

Description

  • Validate inputs in /account/repo/remove and ensure url_for('user_group_view', group=group) is used so Flask can build the required path parameter.

This PR fixes #3347

Notes for Reviewers

  • The user_remove_repo handler now:
    • checks that repo_id and group_name are present and returns the user to account settings with a flash message if not
    • safely converts repo_id to int and handles conversion errors
    • uses url_for("user_group_view", group=group) for the redirect, matching the route /user/group/<group> defined in augur/api/view/routes.py

Signed-off-by: Kabir Panda kabirpa57@gmail.com

Signed commits

  • [✔] Yes, I signed my commits.

@kabir2123 kabir2123 closed this Oct 31, 2025
@MoralCode
Copy link
Contributor

Was there a reason this was closed?

Copy link
Contributor

@MoralCode MoralCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job fixing this issue! just had a small fix and this looks like it should be good to go!

@kabir2123 kabir2123 reopened this Oct 31, 2025
@kabir2123 kabir2123 force-pushed the fix/user_remove_repo-redirect branch from 11e7f4b to 42a7d90 Compare October 31, 2025 20:20
@kabir2123
Copy link
Author

Was there a reason this was closed?

I didnt sign my commit off so had to close it

@MoralCode
Copy link
Contributor

ah ok.
you can sign your commit with git rebase HEAD~1 --signoff (replace the 1 with the number of commits in your branch you want to sign off.

this will rewrite those commits (giving them new hashes) and include a signoff in the commit message.
then do a git push --force to push to your branch and tell git "i know these are different commits than you have - but take these anyway" (careful this can be dangerous

if you prefer not to do this force push, you can also create a new branch at your rewritten commit with git checkout -b <branch name> and push to a new branch and create a new PR from that.

@kabir2123
Copy link
Author

Great I have done the same. Can you please merge the branch now?

@MoralCode
Copy link
Contributor

Great I have done the same. Can you please merge the branch now?

There's still some unaddressed feedback I left on this PR regarding your redirect back to the settings page when there is an error (which prevents users from seeing the flash messages).

I have marked this as accepted for the purposes of hacktoberfest though in case you are participating

@kabir2123 kabir2123 force-pushed the fix/user_remove_repo-redirect branch from 42a7d90 to ade813b Compare November 1, 2025 02:39
@kabir2123
Copy link
Author

Great I have done the same. Can you please merge the branch now?

There's still some unaddressed feedback I left on this PR regarding your redirect back to the settings page when there is an error (which prevents users from seeing the flash messages).

I have marked this as accepted for the purposes of hacktoberfest though in case you are participating

I have made the required changes. Lmk if I need to make any more ammends. I'll be happy to do so. Also I was eyeing on Google Summer of Code and not hacktober fest but Thanks!!!

try:
repo_id = int(repo)
except (TypeError, ValueError):
flash("Invalid repo id provided")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably also print a log message here with the actual exception so the admin of augur knows what specifically happened.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated please check

@kabir2123 kabir2123 force-pushed the fix/user_remove_repo-redirect branch 2 times, most recently from 40f3c90 to be7bade Compare November 1, 2025 16:48
…param and validate inputs

Signed-off-by: Kabir Panda <kabirpanda@Kabirs-MacBook-Air.local>
@kabir2123 kabir2123 force-pushed the fix/user_remove_repo-redirect branch from be7bade to e445b86 Compare November 1, 2025 17:36
@sgoggins sgoggins added bug-fix Fixes a bug and removed hacktoberfest-accepted labels Nov 2, 2025
@MoralCode
Copy link
Contributor

Because this is a fairly narrowly targeted fix for a confirmed crashing scenario, im going to try and get this merged for this release

@MoralCode MoralCode added this to the v0.91.0 Release milestone Nov 3, 2025
@MoralCode MoralCode self-assigned this Nov 3, 2025
@kabir2123
Copy link
Author

Because this is a fairly narrowly targeted fix for a confirmed crashing scenario, im going to try and get this merged for this release

I am contributing for the first time. Hope I was actually able to solve some problem

@MoralCode
Copy link
Contributor

I am contributing for the first time. Hope I was actually able to solve some problem

Welcome! This contribution definitely is helpful - you were able to identify and fix a crash you found in the UI - kudos!

If you plan to stick around or continue using Augur, feel free to check out the getting started page and join the #wg-augur-8knot channel on slack if you'd like to chat with other users and/or the team!

)

from ..server import app
from .utils import *
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it your editor that reformatted a lot of these imports? I dont see anything crazy wrong just wanted to check where this came from

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pylint check was failing coz of the order of imports. So had to make some tweaks

Copy link
Contributor

@MoralCode MoralCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works on my machine and the flash messages (at least in the success case) seem to work

@MoralCode MoralCode added the ready Items tested and seeking additional approvals or a merge. Usually for items under active development label Nov 3, 2025
Copy link
Member

@sgoggins sgoggins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sgoggins sgoggins merged commit 94c714d into chaoss:main Nov 4, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix Fixes a bug ready Items tested and seeking additional approvals or a merge. Usually for items under active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

500 error on repo delete

3 participants