Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

approving an application creates an extra copy #218

Open
TravisWalterLBNL opened this issue Mar 9, 2022 · 3 comments
Open

approving an application creates an extra copy #218

TravisWalterLBNL opened this issue Mar 9, 2022 · 3 comments
Assignees
Labels
bug Something isn't working low priority

Comments

@TravisWalterLBNL
Copy link
Collaborator

I created a new application and exported some app terms and composite terms from a .csv file using my regular account. I logged out and logged back in as an admin user, then went into the application options for the newly created account and changed Sharing to Approved. This caused the application to show up twice in the list of applications, and each of the app terms to show up twice in the list of app terms. The app and app terms should each only show up once in their respective lists.

@wizonesolutions
Copy link
Collaborator

Ah, yes, I have encountered this one myself. It's actually only one application in the database (if you delete one, I believe both disappear), but I think something in one of the queries is confounding things. It probably happened when we implemented the Approved status, then implement the "show public" checkbox.

In technical terms, the database query is probably resulting in a cross multiply during a join. I have a simple workaround in mind that I will have to check the feasibility of in Postgres.

@wizonesolutions
Copy link
Collaborator

wizonesolutions commented Mar 9, 2022

Yep, the issue was exactly as I thought. I've made a fast fix for this issue to unblock us. It's deploying to staging, so check in 15-20 mins.

Then, we should open a follow-up to fix it properly. Basically, when approving an application, the administrator is given an Owner role. I'm not actually sure why this happens, since they have access anyway, and it's not necessary. A non-admin owner can't un-approve an application (not even an admin can). And we show BEDES as the owner whenever the scope is Approved, so it's not important for that either.

But it's basically a cleanup task and probably low priority. It is not significant technical debt at this stage.

@TravisWalterLBNL
Copy link
Collaborator Author

OK, the duplicates are gone on staging. I'll keep this open to remind us that it needs a permanent fix, but I'll change it to low priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority
Projects
None yet
Development

No branches or pull requests

3 participants