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

Bug with image thumbnailing #1

Open
blanchardjeremy opened this issue Oct 5, 2012 · 0 comments
Open

Bug with image thumbnailing #1

blanchardjeremy opened this issue Oct 5, 2012 · 0 comments

Comments

@blanchardjeremy
Copy link
Contributor

In fields.py

        if not self.__dict__.has_key(attribute):
            # Proceed to thumbnail generation only if a *thumbnail* attribute
            # is requested
            if self.field.thumbnails.has_key(attribute):
                # Generate thumbnail
                self._require_file()    # TODO: document this
                if self._verify_thumbnail_requirements():
                    proc_opts = self.field.thumbnails[attribute]
                    t = ThumbnailFieldFile(self.instance, self.field, self, self.name, attribute, proc_opts)
                    t.save()
                    assert self.__dict__[attribute] == t, \
                        Exception('Thumbnail attribute `%s` not set' % attribute)
            else:
                return super(BaseEnhancedImageFieldFile, self).__getattr__(attribute)
        return self.__dict__[attribute]

I'm getting a condition where if self._verify_thumbnail_requirements() is false and then it pops down to self.__dict__[attribute] which throws an error.

I think there should be some logic to account for this.

Unfortunately, I wasn't able to figure out exactly how I got my field/thumbnail into this state. I imagine that's not too helpful. The only steps I remember doing was having an image, editing that model and uploading a new image, and pressing save. My form had an error so I was being redirected back to the form. I guess it could be form some in-between state that the field is in? I'm not sure.

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

1 participant