* Remove read_only field from API OPTIONS
- 'read_only' is a reserved field for some Mantine components
* Fixing further errors for related field model
* Handle bad values for numericalValue
* Fix for default values for API forms
* Fix for choice field
- Do not set form default value when constructing element
* Tweak for PartDetail page
The use of `else` or `elif` becomes redundant and can be dropped if the last statement under the leading `if` / `elif` block is a `return` statement.
In the case of an `elif` after `return`, it can be written as a separate `if` block.
For `else` blocks after `return`, the statements can be shifted out of `else`. Please refer to the examples below for reference.
Refactoring the code this way can improve code-readability and make it easier to maintain.
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
To check if a variable is equal to one of many values, combine the values into a tuple and check if the variable is contained `in` it instead of checking for equality against each of the values.
This is faster, less verbose, and more readable.
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
There shouldn't be any blank lines after the function docstring.
Remove the blank lines to fix this issue.
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
* Implement simple "PartVariantTable" component
- Not yet nested
- More work needed for table nesting
* Fix issue rendering same image multiple times
- Use useId hook to generate random key
* Update PartParameter list API endpoint
- Allow part_detail extra field
- Add FilterSet class
- Allow filter to include variants
* Update PartParameterTable
- Display part column
- Allow returned parts to include templates of base part
- Hide actions for templated parameters
* Fix some code smells
- Until the new frontend is fully ready to be shipped, adding this option only serves to confuse users (and break the install process potentially)
- Remove this option entirely from the invoke script
- Update documentation accordingly
- Only update or create tasks if necessary
- Perform bulk_create and bulk_update operations
- Reduce to N(1) - independent of how many tasks we add in the future
Ref: https://github.com/inventree/InvenTree/issues/5586
- Reduces number of calls to currency_code_defaults()
- Thus reducing number of database hits
(cherry picked from commit 15ff99a24d2a4dcbe38cf4f2c7b886c8820952e8)
* Add some dummy pages for settings
* Add some placeholder pages for settings
* Refactor 'useInstance' hook
- Allow use without a pk
* Make response status code available
* Cleanup user settings page
* Fill out (empty) panels for system settings
* Update URLs
* Add more user information to "me" API endpoint
* Implement global user context
- User information available globally
- Add placeholder page for plugin settings
* remove debug entry
* Add first-pass implementation of plugins table
* Add icon to plugin table
* plugin table improvements
* Add SettingsContext component
- Allows list of settings to be drilled down through props
- Also provides a way of reloading the settings list
* Update settings page
* Update settings detail API endpoints
- No longer case sensitive
* Display boolean values, and allow them to be edited
- Still some work to be done here
- Need to pass the base URL down through useContext
* Allow editing of non-boolean settings too
- Required some adjustment to existing forms interface
* Fix rendering of choice field within modal
* Display correct value for choice fields
* Expose settings units to API
* Updates
- Display units for setting (if available)
- Rename fieldType to field_type
- React does not like snakeCase props
* Improve form handling
* Add global server settings keys
* Add table for project codes
* Use cache to ensure that settings are not rebuilt too often
* Update api version notes
* Add username helper function to user state
* Remove SettingsContext
- Replace with global state manager
- Does not currently refresh properly
* Remove UserContext
* Update BaseContext
* Cleanup to match master
- Integrated many improvements from current master
* Get settings items working again
- Now integrates nicely with userSettingsState and globalSettingsState
* Improve generation of user name
* Handle user settings too
* url endpoint fix
* Add new table for custom unit management
* Update global settings
* Added example for barcode plugin
* Add some words in stock location reports
* Correct error in link
* Correct error in link
* Typo in link
* Style in code example
* Track current panel selection in local storage
* Simplify part detail tabs
* Fix <PanelGroup> instances
* Handle missing model type for rendering
* Add some more API endpoints
* Add PartParameter table
* Add callback to create new part parameter
* Allow PartParameter list API endpoint to be searched
* More PanelGroup collapse tweaks
- Still requires more attention
* Fix logic for related part table
- Need to rebuild columns when part id changes
* Further fixes for related part table
* Re-implement change to PanelGroup
- useLocalStorage
- Change got clobbered in recent merge conflict
* Add part thumbnail to StockItemTable
* Add simple <YesNo> button
- Can be improved later
* Fix for PartTable
* Allow CORS requests to /static/ endpoint
* Updates to other existing tables
* Update URLs for dashboard items
* Improvements to API handling on react UI
- Do not force "/api/" prefix to the base URL of the server
- We will need to fetch media files from the server (at /media/)
- Extend API URL helper functions
* Update some more hard-coded URLs
* Fix search API endpoint
* Fix div for panel tab
* Fix debug msg
* Allow CORS request to /media/
* Add ApiImage component
- Used to fetch images from API which require auth
- Requires some tweaks to back-end CORS settings
- Otherwrise, image loading won't work on new API
* Update build order table
* Remove debug code
* Update part detail page
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Fix: New translations messages.po from Crowdin
* Fix: New translations django.po from Crowdin
* Improvements to API handling on react UI
- Do not force "/api/" prefix to the base URL of the server
- We will need to fetch media files from the server (at /media/)
- Extend API URL helper functions
* Update some more hard-coded URLs
* Fix search API endpoint
* Fix div for panel tab
* Fix debug msg
* Add interface definition for settings
* Fetch global and user settings as state object
* Cleanup dead code
* Fetch settings when performing token login
* Update settings API endpoints:
- Use cache to prevent unnecessary hits to db
- Make settings detail endpoints case insensitive
- Update API version
* Remove is_admin and is_superuser
- Contaminated from other commit
* revert seralizers.py
* Revert breaking change to users/api.py
* Added model changes for StockLocationTypes
* Implement icon for CUI
* Added location type to location table with filters
* Fix ruleset
* Added tests
* Bump api version to v136
* trigger: ci
* Bump api version variable too
* moved search query to strongly typed model reference
* move title and link to reusable typed section
* typed ApiFormFieldType.model too
* renamed symbol
* switched to lookup
* Improved handling of race condition when saving setting value
* Improvements for managing pending migrations
- Inform user if there are outstanding migrations
- reload plugin registry (if necessary)
* Increase django-q polling time
According to this thread, should reduce multiple workers taking the same task:
https://github.com/Koed00/django-q/issues/183#issuecomment-239676084
* Revert default behavior
* Better logging
* Remove comment
* Update unit test
* Revert maintenance mode behaviour
* raise ValidationError in settings