opensupplyhub / open-apparel-registry

An application for searching, matching, uploading factories.
MIT License
32 stars 13 forks source link

Superuser unable to remove list items from pending lists #2220

Closed mariel-oar closed 1 year ago

mariel-oar commented 1 year ago

Overview

There is a button to remove a facility in the list detail view. This button does not currently work.

Desired Behavior

Required: 1) PENDING LIST - Clicking remove on a facility when a list is in pending status, results in the facility being removed from the list and not geocoded (in the event that list is approved)

Nice to have:

2) MESSAGE - Similar to when a list is rejected, there should be a popup when a facility is removed from a pending list. This is free form text box for OS Hub team to message what the issue is. This then triggers an email with OS Hub team's feedback to go to the contributor.

Additional Context:

Screen Shot 2022-10-05 at 11.34.20 AM.png!

Technical Implementation

The API is returning 404

Screen Shot 2022-10-07 at 9 05 35 AM

This is most likely because the remove_item view function includes

            facility_list = FacilityList \
                .objects \
                .filter(source__contributor=request.user.contributor) \
                .get(pk=pk)

and this associated except block

        except FacilityList.DoesNotExist:
            raise NotFound()

Before we updated the workflow to allow the moderation team to handle approve/reject on lists we enforced that only the owner of the list could take action on it

jwalgran commented 1 year ago

I was able to remove an item from a test list in OS Hub staging, so that points to there being a problem with a specific data situation, not the entire feature.

Screen Shot 2022-10-05 at 11 09 18 AM
mariel-oar commented 1 year ago

OS Hub staging, it was from this list: https://9f692df0338dcbc9848646c6.openapparel.org/lists/1733 which is already in approved state; however, I also ran into it on this list which is in pending state: https://9f692df0338dcbc9848646c6.openapparel.org/lists/1765

mariel-oar commented 1 year ago

@obrienad , do you know if the nice to have on this is being implemented?:

Nice to have:

MESSAGE - Similar to when a list is rejected, there should be a popup when a facility is removed from a pending list. This is free form text box for OS Hub team to message what the issue is. This then triggers an email with OS Hub team's feedback to go to the contributor.

jwalgran commented 1 year ago

No. The nice to have popup/email notification when items are removed has not been implemented.

mariel-oar commented 1 year ago

ok, thanks for confirming