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

Add a kludgy 2-step user deletion process to the admin #2150

Merged
merged 3 commits into from
Feb 1, 2019

Conversation

jnm
Copy link
Member

@jnm jnm commented Jan 3, 2019

Please review #2149 first.

This closes kobotoolbox/tasks#32. It works from the Django admin user list only. Trying to delete an individual user from the admin change form will still raise a 500 error.

This isn't great, but let's put our energy toward having separate databases for KoBoCAT and KPI.

Also removes django-guardian dependency
...and fix a troublesome `__unicode__()` method copied from django-guardian
Closes kobotoolbox/tasks#32. It works from the Django admin user list only.
Trying to delete an individual user from the admin change form will still raise
a 500 error.

This isn't great, but let's put our energy toward having separate databases for
KoBoCAT and KPI.
@jnm jnm requested a review from noliveleger January 3, 2019 06:38
@noliveleger
Copy link
Contributor

noliveleger commented Jan 7, 2019

@jnm. I know it's a kludgy 2-step but I'm wondering if we could (at least) deactivate log in as user after using step1. Or just adding a column which display users' current state of deletion. (e.g. Step 1 deletion - done).

I deleted a bunch of users with quite the same usernames. I had to do something between step-1 and step-2. I had a hard time to remember which ones I wanted to delete.

You probably think admin users would not make a pause between 2 steps. You maybe right.

@jnm
Copy link
Member Author

jnm commented Jan 20, 2019

I think I understand why it's a bad workflow, but I'm not sure how deactivating log in as user would help. Could you clarify that, unless you think what I'm about to write would work well enough? :)

What if, after Remove related objects..., we redirected back to a filtered view of users that displayed only the ones whose related objects had just been removed? For example, if we checked off users whose PKs were 1 through 7, clicked Removed related objects..., and confirmed the action, we would then be taken to https://kf.kobotoolbox.org/admin/auth/user/?pk__in=1,2,3,4,5,6,7, which would display only those users. Maybe there's even a way we could have the checkboxes be automatically ticked.

@noliveleger noliveleger merged commit c046875 into master Feb 1, 2019
@noliveleger noliveleger deleted the kobotoolbox/tasks#32-delete-users branch February 1, 2019 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants