Closed hexabits closed 14 years ago
Removing moderation.register(...)
for the model in question, as well as the automoderate()
call in my custom save_model method allowed syncdb to finish without error. I can't really tell the exact problem yet because I don't know enough about the source quite yet.
I could not reproduce your error, but i had other issue when loading objects from fixture, there was exception that ObjectDoesNotExist when checking for unchanged object in pre_save handler. I have fixed this, that objects that are loaded from fixtures does not create ModeratedObject instances for them. You can see it here 9047f6e6aff209c592fcceddf70d828fb504eabc
Please check if this also fix your issue. Also please ensure that you have latest source code.
I actually have run manage syncdb
a few times without getting that error, even before the latest commit.
Then I just realized that the error was not during manage syncdb
but manage test
and it was failing on when it tried importing fixtures, by looking in my shell history it was indeed happening during manage test
.
I do not receive these errors any longer when running manage test
I have managed to reproduce the error. I appears that it ocures when moderated object is saved but it should not be automoderated, automoderation causes multiple save call.
profile = UserProfile.objects.get(user__username='moderator')
profile.description = 'Change description'
profile.save()
profile.moderated_object.changed_by = user
profile.moderated_object.save()
automoderate(profile, user)
I will add is_automoderate
parameter into save method of ModeeratedObject model, default false, it will it only set to True in automoderate
helper.
This should fix the problem.
Or maybe it will be better to move automoderation to separate method, instead of doing it in save method of ModeratedObject. What do you think ?
Fixed issue with multible model save when automoderate was used. Auto moderation in save method of ModeratedObject has been moved to seperate method. Closed by 647b7f653c7feb0b16b4ce04c988bdae2721727d
I tried running
manage syncdb
(UPDATE: It was actuallymanage test
) and received a ~3400 line traceback...Most of it is a repeating pattern relating to moderation, I've cut out the pattern and just left one, but the pattern repeats for over 3000 lines...
Problem installing fixture:
Then after it repeats hundreds of times it continues on over several files to the end of the traceback.