Please verify that this bug has NOT been raised before.
[X] I checked and didn't find a similar issue
Describe the bug*
I'm in the middle of building a GUI for the Inventree / KiCad integration via plugin 'kicad-library-plugin'.
I'm new to the Inventree Development Ecosystem, but as far as I can see, the plugin options for each enabled category are stored in the metadata.
Since it can be tedious to enable 50+ categories to be available in KiCad, I tried to access the data via the API endpoint 'plugins_metadata_retrieve'.
However this always fails with an Error 500 and the additional message
{ "error": "AssertionError", "error_class": "<class 'AssertionError'>", "detail": "Error details can be found in the admin panel", "path": "/api/plugins/digikeyplugin/metadata/", "status_code": 500 }
The admin panals says the following:
`Traceback (most recent call last):
File "/root/.local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/generics.py", line 252, in get
return self.retrieve(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/mixins.py", line 54, in retrieve
instance = self.get_object()
^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/generics.py", line 88, in get_object
assert lookup_url_kwarg in self.kwargs, (
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected view MetadataView to be called with a URL keyword argument named "key". Fix your URL conf, or set the .lookup_field attribute on the view correctly.`
This happens with the mentioned plugin 'kicad-library-plugin' as well as with default plugins like 'inventreelabelmachine'.
Please verify if you can reproduce this bug on the demo site.
[X] I can reproduce this bug on the demo site.
Relevant log output
Traceback (most recent call last):
File "/root/.local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/generics.py", line 252, in get
return self.retrieve(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/mixins.py", line 54, in retrieve
instance = self.get_object()
^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/generics.py", line 88, in get_object
assert lookup_url_kwarg in self.kwargs, (
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected view MetadataView to be called with a URL keyword argument named "key". Fix your URL conf, or set the `.lookup_field` attribute on the view correctly.
Please verify that this bug has NOT been raised before.
Describe the bug*
I'm in the middle of building a GUI for the Inventree / KiCad integration via plugin 'kicad-library-plugin'. I'm new to the Inventree Development Ecosystem, but as far as I can see, the plugin options for each enabled category are stored in the metadata. Since it can be tedious to enable 50+ categories to be available in KiCad, I tried to access the data via the API endpoint 'plugins_metadata_retrieve'.
However this always fails with an Error 500 and the additional message
{ "error": "AssertionError", "error_class": "<class 'AssertionError'>", "detail": "Error details can be found in the admin panel", "path": "/api/plugins/digikeyplugin/metadata/", "status_code": 500 }
The admin panals says the following: `Traceback (most recent call last):
File "/root/.local/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch response = handler(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/generics.py", line 252, in get return self.retrieve(request, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/mixins.py", line 54, in retrieve instance = self.get_object() ^^^^^^^^^^^^^^^^^
File "/root/.local/lib/python3.11/site-packages/rest_framework/generics.py", line 88, in get_object assert lookup_url_kwarg in self.kwargs, ( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Expected view MetadataView to be called with a URL keyword argument named "key". Fix your URL conf, or set the
.lookup_field
attribute on the view correctly.`This happens with the mentioned plugin 'kicad-library-plugin' as well as with default plugins like 'inventreelabelmachine'.
Steps to Reproduce
Expected behaviour
Response code 200. If there is no metadata for the plugin, return an empty json
{}
Deployment Method
Version Information
Version Information:
InvenTree-Version: 0.16.0 dev Django Version: 4.2.14 Commit Hash: 6937b3a Commit Date: 2024-08-05
Database: postgresql Debug-Mode: False Deployed using Docker: True Platform: Linux-6.5.0-27-generic-x86_64-with Installer: DOC
Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}, {'name': 'KiCadLibraryPlugin', 'slug': 'kicad-library-plugin', 'version': '1.4.2'}]
Please verify if you can reproduce this bug on the demo site.
Relevant log output