-
Notifications
You must be signed in to change notification settings - Fork 104
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
UnboundLocalError ('version') when creating deleted list in get_many_to_something() #41
Comments
v0.5.4 release is out. Has this been fixed? |
Nope, the problem still exists and keeps me from comparing my custom user model. While the OneToOne fix fixes the first parts of my problem, this problem still exist. The code that got merges from theodore should probably be reverted or fixed as this is a bug. |
Thanks for the feedback. Then i need a way to reproduce this bug and write a unitests for this case. Seems that you have the configuration for it. Can you copy&paste a simple example code and a full traceback ? |
Sure, if you need some code to test with I might have the time to create an example tomorrow. But if you read the code you can clearly see that Stack trace:
|
This would be great. If you have the time: create a unittest for it ;)
Yes, i see. EDIT: Maybe:
|
I add some test prints. The code part are running in the unittests. But in this case "version" object exist! Think because of the usage before, here: django-reversion-compare/reversion_compare/admin.py Lines 157 to 158 in fe7d02f
I renamed "version.revision" to "old_revision"... The unittest passed: https://travis-ci.org/jedie/django-reversion-compare/builds/72319025 But i can't really see if this is the right behaviour :( TODO: Add a unittest with "if self.has_int_pk:" == False and check if the if ver.revision.date_created < old_revision.date_created: code part does really the right thing... @frwickst Can you test with the new commits? |
It works! Thanks for the fix, now I can finally compare my users history 👍 |
Thanks for feedback. i released v0.5.5 |
This is a bug that was introduced by theodore.therone@gmail.com 9c81a09
The error is:
local variable 'version' referenced before assignment
The variable
version
is used before it is assigned anything leading to the error.The text was updated successfully, but these errors were encountered: