2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 11:40:58 +00:00
* Add basic endpoint for group information

* Add hardcoded api-url lookup function for django models

* Adds JS function for rendering a 'group'

* Fix typo

* Add unit tests for new endpoints

* Increment API version

* JS linting
This commit is contained in:
Oliver
2023-02-11 07:09:59 +11:00
committed by GitHub
parent 06605e70c5
commit f4e8c05165
8 changed files with 147 additions and 8 deletions

View File

@ -704,6 +704,17 @@ class BaseInvenTreeSetting(models.Model):
except Exception:
pass
# Some other model types are hard-coded
hardcoded_models = {
'auth.user': 'api-user-list',
'auth.group': 'api-group-list',
}
model_table = f'{model_class._meta.app_label}.{model_class._meta.model_name}'
if url := hardcoded_models[model_table]:
return reverse(url)
return None
def is_bool(self):