Skip to content

Fix attempting to access deferred fields in stdimage file descriptor #204

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

Merged
merged 2 commits into from
Nov 23, 2018

Conversation

chaosk
Copy link

@chaosk chaosk commented Nov 22, 2018

StdImageField.set_variations will no longer attempt to access file field when the file field is deferred.

Before this change, any instance with deferred image field would result in an additional query to retrieve the image field value, as set_variations attempts to overwrite image field value.

Fixes #203

@codecov
Copy link

codecov bot commented Nov 22, 2018

Codecov Report

Merging #204 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #204      +/-   ##
==========================================
+ Coverage   96.92%   96.94%   +0.01%     
==========================================
  Files           5        5              
  Lines         228      229       +1     
==========================================
+ Hits          221      222       +1     
  Misses          7        7
Impacted Files Coverage Δ
stdimage/models.py 95.31% <100%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1ff71ac...6ce9590. Read the comment docs.

Copy link
Owner

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @chaosk good work. With tests and everything, love it!
I would have once request. Could you extend your test, that it ensures that you can access the deferred field and also the variations are accessible?

@codingjoe codingjoe merged commit 920c68b into codingjoe:master Nov 23, 2018
@codingjoe
Copy link
Owner

Released in 4.0.1

@codingjoe
Copy link
Owner

Thanks @chaosk what a pleasure!

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

Successfully merging this pull request may close these issues.

2 participants