You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have the weirdest bug that I've been chasing around for a couple of days now. Image-filer works on our servers but it doesn't work for me locally while developing. Python versions match and if I enable DEBUG on the server, it keeps working there. But not here.
What happens is this: when I upload a file I get the error "'NoneType' object has no attribute 'now'" in image_filer/models/init.py, line 244. Weird, since datetime gets imported fine. When I put "from datetime import datetime" right in front of that line, it works but fails at line 270 with something along the lines of "super needs a class, not None as first parameter".
Stepping through the code with pdb I notice that while in the save function, all references to earlier defined imports and classes are None! datetime is None, Image is None, everything outside of the function itself is None!
Stepping through the whole code, I notice that in all function of all classes in that init.py file all earlier imports and definitions are None - except for AbstractFile. Stepping through unicode() there, I can still access datetime, etc.
Any idea what's happening here?
Thanks,
Jonas
The text was updated successfully, but these errors were encountered:
if 'cms' in settings.INSTALLED_APPS:
from cms.models import CMSPlugin, Page
in models/init.py up to the top of the file, where the other imports are - and now it works. Beats me why this happened but I think it's got to do with some metaclass magic the CMS app is doing.
I can confirm the problem and the "solution". This is an absolutely annoying bug because it is not debuggable by a normal developer. How can datetime become None without explicit code causing that?
I have the weirdest bug that I've been chasing around for a couple of days now. Image-filer works on our servers but it doesn't work for me locally while developing. Python versions match and if I enable DEBUG on the server, it keeps working there. But not here.
What happens is this: when I upload a file I get the error "'NoneType' object has no attribute 'now'" in image_filer/models/init.py, line 244. Weird, since datetime gets imported fine. When I put "from datetime import datetime" right in front of that line, it works but fails at line 270 with something along the lines of "super needs a class, not None as first parameter".
Stepping through the code with pdb I notice that while in the save function, all references to earlier defined imports and classes are None! datetime is None, Image is None, everything outside of the function itself is None!
Stepping through the whole code, I notice that in all function of all classes in that init.py file all earlier imports and definitions are None - except for AbstractFile. Stepping through unicode() there, I can still access datetime, etc.
Any idea what's happening here?
Thanks,
Jonas
The text was updated successfully, but these errors were encountered: