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

Avoid silently changing settings; raise ImproperlyConfigured instead #520

Merged
merged 1 commit into from
Jul 6, 2018
Merged

Avoid silently changing settings; raise ImproperlyConfigured instead #520

merged 1 commit into from
Jul 6, 2018

Conversation

jdufresne
Copy link
Contributor

If a setting is considered invalid, raise an exception instead of silently changing it to some other value. Avoids confusion and forces the library user to be explicit.

For example, setting S3 location to a value with a leading slash previously stripped it. Instead, now instruct the user to use a valid value without the leading slash.

If a setting is considered invalid, raise an exception instead of
silently changing it to some other value. Avoids confusion and forces
the library user to be explicit.

For example, setting S3 location to a value with a leading slash
previously stripped it. Instead, now instruct the user to use a valid
value without the leading slash.
@codecov-io
Copy link

codecov-io commented Jul 4, 2018

Codecov Report

Merging #520 into master will increase coverage by 0.3%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #520     +/-   ##
=========================================
+ Coverage   76.48%   76.79%   +0.3%     
=========================================
  Files          11       11             
  Lines        1595     1599      +4     
=========================================
+ Hits         1220     1228      +8     
+ Misses        375      371      -4
Impacted Files Coverage Δ
storages/backends/s3boto.py 88.7% <100%> (+0.66%) ⬆️
storages/backends/s3boto3.py 87.72% <100%> (+0.59%) ⬆️
storages/utils.py 97.22% <100%> (+0.34%) ⬆️
storages/backends/gcloud.py 94.94% <100%> (ø) ⬆️

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 675856a...1380301. Read the comment docs.

@sww314 sww314 merged commit bb71260 into jschneier:master Jul 6, 2018
@jdufresne jdufresne deleted the location branch July 6, 2018 20:07
sww314 added a commit that referenced this pull request Jul 6, 2018
Fix missing import needed in #520
nitely pushed a commit to satellogic/django-storages that referenced this pull request Jul 30, 2018
@jschneier
Copy link
Owner

Sorry I didn't comment on this one. What do you guys think of a system check? An issue at runtime to me should be the last resort.

@jdufresne
Copy link
Contributor Author

That would be great. Unfortunately, I believe a system check would require an entry in INSTALLED_APPS which doesn't exist for django-storages.

@jschneier
Copy link
Owner

jschneier commented Aug 12, 2018 via email

@jdufresne
Copy link
Contributor Author

Interesting. Thanks for pointing that out.

django-storages doesn't actually have a need for using INSTALLED_APPS. We can simplify the installation by removing it. I have been successfully using django-storages without INSTALLED_APPS on projects for years. Using an app would be required for things like models, migrations, templates, and templatetags. The configuration used, DEFAULT_FILE_STORAGE, can be any valid Python path even if it isn't a configured app. With that, I think it would be better to have simpler install instructions. I created PR #547 to do so.

@jschneier
Copy link
Owner

jschneier commented Aug 12, 2018 via email

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.

4 participants