burke-software / django-mass-edit

Make bulk changes in the Django admin interface
155 stars 68 forks source link

Catching an error? #15

Closed gamesbook closed 9 years ago

gamesbook commented 11 years ago

I am getting this error:

File "/usr/local/lib/python2.7/dist-packages/massadmin/massadmin.py" in mass_change_view
  193.                         raise Exception('Some of the selected objects could\'t be changed.')

There is nothing in the stack trace to indicate what is causing it or what records are not changed.

How I do catch this exception and report to the user which records could not be changed (and why)?

bufke commented 11 years ago

The code is kind of just terrible here with error handling. If I have time I'll rewrite it. Maybe you can talk with your user and find a test case that is reproducible.

On line 181 there is a check to make sure the formsets are valid. I'm guessing they are not. Ideally it should show this error to the user instead of just raising an exception.

gamesbook commented 11 years ago

Should I try and alter that code and see if it make a difference? Ideally, I'd like to figure out what specifically in the data is causing the problem...

On 2 September 2013 19:04, David Burke notifications@github.com wrote:

The code is kind of just terrible here with error handling. If I have time I'll rewrite it. Maybe you can talk with your user and find a test case that is reproducible.

On line 181 there is a check to make sure the formsets are valid. I'm guessing they are not. Ideally it should show this error to the user instead of just raising an exception.

— Reply to this email directly or view it on GitHubhttps://github.com/burke-software/django-mass-edit/issues/15#issuecomment-23670620 .

bufke commented 11 years ago

Yes give it a try. If you comment out the raise exception it will commit to the database and you can see what did and didn't change.

I think ultimately I want to not commit to database and list all the errors for the user.

On Mon, Sep 2, 2013 at 2:32 PM, gamesbook notifications@github.com wrote:

Should I try and alter that code and see if it make a difference? Ideally, I'd like to figure out what specifically in the data is causing the problem...

On 2 September 2013 19:04, David Burke notifications@github.com wrote:

The code is kind of just terrible here with error handling. If I have time I'll rewrite it. Maybe you can talk with your user and find a test case that is reproducible.

On line 181 there is a check to make sure the formsets are valid. I'm guessing they are not. Ideally it should show this error to the user instead of just raising an exception.

— Reply to this email directly or view it on GitHub< https://github.com/burke-software/django-mass-edit/issues/15#issuecomment-23670620>

.

— Reply to this email directly or view it on GitHubhttps://github.com/burke-software/django-mass-edit/issues/15#issuecomment-23673661 .

gamesbook commented 10 years ago

I have made a comment about this on issue #24 .