-
-
Notifications
You must be signed in to change notification settings - Fork 834
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
Update demo data hook to copy media files #3441
Update demo data hook to copy media files #3441
Conversation
- get_setting function has been streamlined - move some functions into config.py
- invoke path is still mucking us around
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SchrodingersGat not sure if i am miss understanding something but a bunch of config.yaml names seem to be renamed. This PR is highly breaking configs of that is the case.
InvenTree/InvenTree/config.py
Outdated
with open(secret_key_file, 'r') as f: | ||
key_data = f.read().strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with open(secret_key_file, 'r') as f: | |
key_data = f.read().strip() | |
key_data=secret_key_file.read_text().strip() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed in d17e3dc
InvenTree/InvenTree/settings.py
Outdated
'workers': background_workers, | ||
'timeout': 90, | ||
'workers': int(get_setting('INVENTREE_BACKGROUND_WORKERS', 'background.workers', 4)), | ||
'timeout': int(get_setting('INVENTREE_BACKGROUND_TIMEOUT', 'background.timeout', 4)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: the old default was 90; why the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because "whoops". Fixed in 2492811. Thanks!
InvenTree/InvenTree/settings.py
Outdated
@@ -856,8 +718,8 @@ def _is_true(x): | |||
SOCIALACCOUNT_STORE_TOKENS = True | |||
|
|||
# settings for allauth | |||
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = get_setting('INVENTREE_LOGIN_CONFIRM_DAYS', CONFIG.get('login_confirm_days', 3)) | |||
ACCOUNT_LOGIN_ATTEMPTS_LIMIT = get_setting('INVENTREE_LOGIN_ATTEMPTS', CONFIG.get('login_attempts', 5)) | |||
ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = get_setting('INVENTREE_LOGIN_CONFIRM_DAYS', 'login.confirm_days', 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: is this a breaking change in the config file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now thanks for pointing out.
InvenTree/InvenTree/settings.py
Outdated
@@ -877,8 +739,8 @@ def _is_true(x): | |||
ACCOUNT_ADAPTER = 'InvenTree.forms.CustomAccountAdapter' | |||
|
|||
# login settings | |||
REMOTE_LOGIN = get_setting('INVENTREE_REMOTE_LOGIN', CONFIG.get('remote_login', False)) | |||
REMOTE_LOGIN_HEADER = get_setting('INVENTREE_REMOTE_LOGIN_HEADER', CONFIG.get('remote_login_header', 'REMOTE_USER')) | |||
REMOTE_LOGIN = get_boolean_setting('INVENTREE_REMOTE_LOGIN', 'remote_login.enabled', False) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: new config path?
InvenTree/InvenTree/settings.py
Outdated
REMOTE_LOGIN = get_setting('INVENTREE_REMOTE_LOGIN', CONFIG.get('remote_login', False)) | ||
REMOTE_LOGIN_HEADER = get_setting('INVENTREE_REMOTE_LOGIN_HEADER', CONFIG.get('remote_login_header', 'REMOTE_USER')) | ||
REMOTE_LOGIN = get_boolean_setting('INVENTREE_REMOTE_LOGIN', 'remote_login.enabled', False) | ||
REMOTE_LOGIN_HEADER = get_setting('INVENTREE_REMOTE_LOGIN_HEADER', 'remote_login.header', 'REMOTE_USER') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deto
@@ -932,7 +795,7 @@ def _is_true(x): | |||
sentry_sdk.set_tag(f'inventree_{key}', val) | |||
|
|||
# In-database error logging | |||
IGNORRED_ERRORS = [ | |||
IGNORED_ERRORS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment: gotta love the typos - that is how you recognize me being in a code base
InvenTree/InvenTree/settings.py
Outdated
CONFIG.get('customize', {}), | ||
{} | ||
) | ||
CUSTOMIZE = CONFIG.get('customize', {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: is the env variable removed here? Seems breaking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f41af88
- Prevent breaking changes
I have reverted these now, the only changes for |
@SchrodingersGat should be good to go |
Existing script for installing demo dataset does not copy across media files!
This PR started with an initially simple goal - to copy these media files across.
However to gain access to the canonical location of the
MEDIA_ROOT
directory, we needed some extra code to provide that information to external scripts!This ended up leading to a significant refactor of the "settings.py" file
Documentation
Required some updates (and improvements) to the documentation, inventree/inventree-docs#342