loicginoux / joanne_project

joanne's project
2 stars 1 forks source link

Admin console broken when deleting a user #336

Closed jdaudier closed 11 years ago

jdaudier commented 11 years ago

Tried to delete user Amui and got this error

2013-05-06_1519

jdaudier commented 11 years ago

Maybe it's because I changed my email address on the main site?

loicginoux commented 11 years ago

No it's Heroku who complain about your request taking too long. When deleting a user, we need to delete all his associated object in database and all his photos in Amazon S3. On the Amui case, it took 35 seconds to finish the task and Heroku send an error message after 30 seconds. The solution for this would be to delegate this task to a background process so that you don't wait that long but background processes are not included in the Heroku free plan.

jdaudier commented 11 years ago

Are you able to delete Amui?

loicginoux commented 11 years ago

Yes I can delete her with the terminal. What you can do without deleting her account is just to set the active flag to false.

jdaudier commented 11 years ago

So does this mean I won't be able to delete users in the future?

jdaudier commented 11 years ago

Is my admin login the same as my main site's login? I switched email and the admin console asks for an email.

loicginoux commented 11 years ago

no your admin account and your user account are different.


Loïc Ginoux Freelance web engineer

Site: loicginoux.com Email: lginoux http://lginoux.pro/@gmail.com Twitter: @loicginoux http://twitter.com/#!/loicginoux

Tel: +34 638 246 893

On 8 May 2013 20:05, jdaudier notifications@github.com wrote:

Is my admin login the same as my main site's login? I switched email and the admin console asks for an email.

— Reply to this email directly or view it on GitHubhttps://github.com/loicginoux/joanne_project/issues/336#issuecomment-17623250 .

jdaudier commented 11 years ago

How can I change the email for my admin account from joanne@learnstreet.com to jdaudier@gmail.com?

loicginoux commented 11 years ago

if you go to the admin panel, and go to the tab admin users, you can modify your admin user account.


Loïc Ginoux Freelance web engineer

Site: loicginoux.com Email: lginoux http://lginoux.pro/@gmail.com Twitter: @loicginoux http://twitter.com/#!/loicginoux

Tel: +34 638 246 893

On 8 May 2013 23:14, jdaudier notifications@github.com wrote:

How can I change the email for my admin account from joanne@learnstreet.com to jdaudier@gmail.com?

— Reply to this email directly or view it on GitHubhttps://github.com/loicginoux/joanne_project/issues/336#issuecomment-17634389 .

jdaudier commented 11 years ago

I couldn't delete orangetokyo either. Is there any way to fix this without having to upgrade Heroku plan?

loicginoux commented 11 years ago

The problem is that it takes quite some time for heroku to tell Amazon S3 to delete all files from this user ()she has about 250 images to delete. solutions: 1 - Not deleting the photos from this user when deleting him/her. this way it won't take that long but It might have some bad consequences as you will stay with photos linked to a deleted user. This will probably break few pages ( /admin/data_points, and feed page) 2 - not deleting photos but adding a flag active to false on her photos, this way photos would stay on the app but won't be visible neither accessible anywhere 3 - Remove all photos of the user first and then deleting the user. At the moment you can delete them only one by one but I could add a batch delete action on the /admin/data_points page to be able to do it.
4 - only deactivating the user. Everything will stay in the app but won't be accessible. 5 - asking me to do it with the terminal directly on the server, as there is no timeout for processes. This way it's really quick but it would mean asking me for every user.

For now I delete her on terminal. think about which solution you would prefer for next one, I prefer the third one. I am gonna have a look at adding this batch action on this admin page. That should be quick to add.

loicginoux commented 11 years ago

solution 3 is now working, you ca nselect several photos and delete them using the button "batch action"

jdaudier commented 11 years ago

Great! So remove photos first and then delete user?

loicginoux commented 11 years ago

Yes, you first select all photos from a specific user, then select all and delete. When all photos have been deleted it will be a lot quicker to delete a user.


Loïc Ginoux Freelance web engineer

Site: loicginoux.com Email: lginoux http://lginoux.pro/@gmail.com Twitter: @loicginoux http://twitter.com/#!/loicginoux

Tel: +34 638 246 893

On 16 May 2013 16:11, jdaudier notifications@github.com wrote:

Great! So remove photos first and then delete user?

— Reply to this email directly or view it on GitHubhttps://github.com/loicginoux/joanne_project/issues/336#issuecomment-18003330 .