mirror of
https://github.com/inventree/InvenTree.git
synced 2026-05-28 03:49:20 +00:00
!refactor(backend): remove legacy user endpoints (#11985)
* realign user API endpoints (#11963)
* realign user API endpoints to make it clearer which one are only applicable to the current user
* fix name
* bump api
* fix test
* fix reference
* fix test exception
* update ref
* reduce breakage
* re-add legacy urls till next `breaking`
(cherry picked from commit 9908870a81)
* remove fallback
* fix style
* fix style
* fix performance test
This commit is contained in:
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- [#11111](https://github.com/inventree/InvenTree/pull/11111) - removes legacy metadata APIs
|
||||
- [#9814](https://github.com/inventree/InvenTree/pull/9814) - removes legacy config path support
|
||||
- [#11667](https://github.com/inventree/InvenTree/pull/11667) - removes legacy url patterns
|
||||
- [#11985](https://github.com/inventree/InvenTree/pull/11985) - removes legacy user endpoint fallback
|
||||
|
||||
|
||||
## Unreleased - YYYY-MM-DD
|
||||
|
||||
@@ -33,7 +33,6 @@ from InvenTree.mixins import (
|
||||
SerializerContextMixin,
|
||||
UpdateAPI,
|
||||
)
|
||||
from InvenTree.schema import exclude_from_schema
|
||||
from InvenTree.settings import FRONTEND_URL_BASE
|
||||
from users.models import ApiToken, Owner, RuleSet, UserProfile
|
||||
from users.serializers import (
|
||||
@@ -502,25 +501,6 @@ class UserProfileDetail(RetrieveUpdateAPI):
|
||||
|
||||
|
||||
user_urls = [
|
||||
# Legacy endpoints (to avoid breaking existing API clients)
|
||||
# TODO @matmair - remove these legacy endpoints in the next breaking release
|
||||
path(
|
||||
'roles/',
|
||||
exclude_from_schema(RoleDetails, '/api/user/me/roles/').as_view(),
|
||||
name='api-user-roles_legacy',
|
||||
),
|
||||
path(
|
||||
'token/',
|
||||
ensure_csrf_cookie(
|
||||
exclude_from_schema(GetAuthToken, '/api/user/me/token/').as_view()
|
||||
),
|
||||
name='api-token_legacy',
|
||||
),
|
||||
path(
|
||||
'profile/',
|
||||
exclude_from_schema(UserProfileDetail, '/api/user/me/profile/').as_view(),
|
||||
name='api-user-profile_legacy',
|
||||
),
|
||||
# Individual user endpoints
|
||||
path(
|
||||
'me/',
|
||||
|
||||
@@ -50,7 +50,7 @@ def test_api_auth_performance():
|
||||
'/api/order/so/shipment/',
|
||||
#'/api/order/po/',
|
||||
#'/api/order/po-line/',
|
||||
'/api/user/roles/',
|
||||
'/api/user/me/roles/',
|
||||
'/api/parameter/',
|
||||
'/api/parameter/template/',
|
||||
],
|
||||
@@ -77,7 +77,7 @@ def test_api_list_performance(url):
|
||||
'/api/order/so/shipment/',
|
||||
'/api/order/po/',
|
||||
'/api/order/po-line/',
|
||||
'/api/user/roles/',
|
||||
'/api/user/me/roles/',
|
||||
'/api/parameter/',
|
||||
'/api/parameter/template/',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user