google-code-export / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Saving photo size #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add new photo size
2. Save with name "thumbnail"

What is the expected output? What do you see instead?
Traceback:
File "/home/remik/django/django_src/django/core/handlers/base.py" in
get_response
  82.                 response = callback(request, *callback_args,
**callback_kwargs)
File
"/home/remik/django/django_src/django/contrib/admin/views/decorators.py" in
_checklogin
  62.             return view_func(request, *args, **kwargs)
File "/home/remik/django/django_src/django/views/decorators/cache.py" in
_wrapped_view_func
  44.         response = view_func(request, *args, **kwargs)
File "/home/remik/django/django_src/django/contrib/admin/views/main.py" in
add_stage
  264.             new_object = manipulator.save(new_data)
File "/home/remik/django/django_src/django/db/models/manipulators.py" in save
  109.         new_object.save()
File "/home/remik/django/django_projects/dgallery/photologue/models.py" in save
  521.         self.clear_cache()
File "/home/remik/django/django_projects/dgallery/photologue/models.py" in
clear_cache
  515.                 photo.create_size(self)
File "/home/remik/django/django_projects/dgallery/photologue/models.py" in
create_size
  353.         resized_filename = getattr(self, "get_%s_path" %
photosize.name)()

Exception Type: AttributeError at /panel/photologue/photosize/add/
Exception Value: 'Photo' object has no attribute 'get_thumbnail_path'

What version of the product are you using? On what operating system?
1.0b

Please provide any additional information below.

Index: photologue/models.py
===================================================================
--- photologue/models.py    (revision 172)
+++ photologue/models.py    (working copy)
@@ -297,7 +297,7 @@
         return False

     def create_size(self, photosize):
-        if self.size_exists(photosize):
+        if not self.size_exists(photosize):
             return
         if not os.path.isdir(self.cache_path()):
             os.makedirs(self.cache_path())

Original issue reported on code.google.com by remigi...@gmail.com on 14 Mar 2008 at 11:45

GoogleCodeExporter commented 9 years ago
This is a known issue. See issue 30 
(http://code.google.com/p/django-photologue/issues/detail?id=30). The 
quick fix is to save the photo size without pre_cache selected and open the 
photo size and select it before saving 
again. This should be fixed in 1.0 final.

Original comment by justin.d...@gmail.com on 15 Mar 2008 at 12:05

GoogleCodeExporter commented 9 years ago
Yes, you are right. Please close this bug as duplicate.

Original comment by remigi...@gmail.com on 15 Mar 2008 at 11:24

GoogleCodeExporter commented 9 years ago

Original comment by justin.d...@gmail.com on 16 Mar 2008 at 1:12