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

Auto-approval / automoderation issues in the admin? #46

Open
swiharta opened this issue Oct 23, 2011 · 4 comments
Open

Auto-approval / automoderation issues in the admin? #46

swiharta opened this issue Oct 23, 2011 · 4 comments

Comments

@swiharta
Copy link

In the admin, as a superuser editing an instance of a model registered with django_moderation, I have to save the instance twice in order for it to take effect. I'm not using ModerationAdmin.

After the first save, the ModeratedObject edit view in the admin displays the change difference correctly, moderation_reason says "Auto-approved: Superuser", and the status is Approved, but as I said the actual model instance remains unchanged until I save it again. As I discovered later, no matter what changes I make the second time I save, only the changes from the first save are applied to the model instance after saving the second time.

I took a little time to test this a bit more, thought someone might want to know:

If I apply change A (Boolean) and change B (ForeignKey) the first time I save an existing model instance in the admin, then only change A the second time I save, both changes A and B are applied to the model instance as if I had just done the first save. In fact, as I mentioned above, it doesn't matter what changes I make before doing the second save.

As far as the ModeratedObject edit view in the admin, any change that was applied only once displays the change difference with the changes highlighted as I said. Any change applied twice consecutively just displays the new value without the highlighting.

Seems like there is some issue with auto-approval / automoderation in the admin or the way the changed objects are getting passed around? Haven't tested from shell or in views.

As an alternative to saving the object twice, if I go and approve the change in the ModeratedObject admin (despite the existing "approved" status), then the actual model instance gets updated with the saved changes. So to me it seems like maybe some part of the auto-approval process is not working correctly.

@dominno
Copy link
Owner

dominno commented Nov 30, 2011

This could be solved by some changes merge, when doing one change after another.

@swiharta
Copy link
Author

swiharta commented Dec 1, 2011

Sorry, I don't understand, but if you figured out what my issue was, then great!

@dominno
Copy link
Owner

dominno commented Dec 1, 2011

I ment that this need to be implemented, this is probably related to moderation history per object.

@DmytroLitvinov
Copy link
Collaborator

Hi @dominno ,

Could we close this issue?

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

No branches or pull requests

3 participants