mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-10 06:37:17 +00:00
Merge branch 'master' into migration-fix
This commit is contained in:
@@ -1,11 +1,14 @@
|
|||||||
"""InvenTree API version information."""
|
"""InvenTree API version information."""
|
||||||
|
|
||||||
# InvenTree API version
|
# InvenTree API version
|
||||||
INVENTREE_API_VERSION = 543
|
INVENTREE_API_VERSION = 544
|
||||||
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
|
||||||
|
|
||||||
INVENTREE_API_TEXT = """
|
INVENTREE_API_TEXT = """
|
||||||
|
|
||||||
|
v544 -> 2026-09-07 : https://github.com/inventree/InvenTree/pull/12807
|
||||||
|
- Adds filtering by filename on the Attachment list API endpoint
|
||||||
|
|
||||||
v543 -> 2026-09-05 : https://github.com/inventree/InvenTree/pull/12762
|
v543 -> 2026-09-05 : https://github.com/inventree/InvenTree/pull/12762
|
||||||
- Adds admin APIs for managing SSO applications
|
- Adds admin APIs for managing SSO applications
|
||||||
|
|
||||||
|
|||||||
@@ -873,6 +873,10 @@ class AttachmentFilter(FilterSet):
|
|||||||
|
|
||||||
tag_name = common.filters.TagsFilter()
|
tag_name = common.filters.TagsFilter()
|
||||||
|
|
||||||
|
filename = rest_filters.CharFilter(
|
||||||
|
field_name='attachment', lookup_expr='icontains', label=_('Filename')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_viewable_attachment_model_types(user) -> set:
|
def get_viewable_attachment_model_types(user) -> set:
|
||||||
"""Return the set of attachment 'model_type' labels the user has 'view' permission for.
|
"""Return the set of attachment 'model_type' labels the user has 'view' permission for.
|
||||||
@@ -909,7 +913,7 @@ class AttachmentList(AttachmentMixin, BulkDeleteMixin, ListCreateAPI):
|
|||||||
filterset_class = AttachmentFilter
|
filterset_class = AttachmentFilter
|
||||||
|
|
||||||
ordering_fields = ['model_id', 'model_type', 'upload_date', 'file_size']
|
ordering_fields = ['model_id', 'model_type', 'upload_date', 'file_size']
|
||||||
search_fields = ['comment', 'model_id', 'model_type']
|
search_fields = ['comment', 'model_id', 'model_type', 'attachment']
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
"""Restrict the queryset to attachments linked to a model the user can view."""
|
"""Restrict the queryset to attachments linked to a model the user can view."""
|
||||||
|
|||||||
Reference in New Issue
Block a user