diff --git a/InvenTree/build/templates/build/detail.html b/InvenTree/build/templates/build/detail.html
index d53122cdd1..31e9f38080 100644
--- a/InvenTree/build/templates/build/detail.html
+++ b/InvenTree/build/templates/build/detail.html
@@ -247,7 +247,9 @@
diff --git a/InvenTree/part/api.py b/InvenTree/part/api.py
index 20447a4d26..dc521b42c6 100644
--- a/InvenTree/part/api.py
+++ b/InvenTree/part/api.py
@@ -177,6 +177,17 @@ class CategoryDetail(generics.RetrieveUpdateDestroyAPIView):
return ctx
+ def update(self, request, *args, **kwargs):
+
+ if 'starred' in request.data:
+ starred = str2bool(request.data.get('starred', False))
+
+ self.get_object().set_starred(request.user, starred)
+
+ response = super().update(request, *args, **kwargs)
+
+ return response
+
class CategoryParameterList(generics.ListAPIView):
""" API endpoint for accessing a list of PartCategoryParameterTemplate objects.
@@ -446,7 +457,7 @@ class PartDetail(generics.RetrieveUpdateDestroyAPIView):
"""
if 'starred' in request.data:
- starred = str2bool(request.data.get('starred', None))
+ starred = str2bool(request.data.get('starred', False))
self.get_object().set_starred(request.user, starred)
diff --git a/InvenTree/part/serializers.py b/InvenTree/part/serializers.py
index 981d143507..3b6d823ddc 100644
--- a/InvenTree/part/serializers.py
+++ b/InvenTree/part/serializers.py
@@ -35,8 +35,6 @@ class CategorySerializer(InvenTreeModelSerializer):
def __init__(self, *args, **kwargs):
- self.starred_categories = kwargs.pop('starred_categories', [])
-
super().__init__(*args, **kwargs)
def get_starred(self, category):
@@ -44,7 +42,7 @@ class CategorySerializer(InvenTreeModelSerializer):
Return True if the category is directly "starred" by the current user
"""
- return category in self.starred_categories
+ return category in self.context.get('starred_categories', [])
url = serializers.CharField(source='get_absolute_url', read_only=True)
diff --git a/InvenTree/part/templates/part/category.html b/InvenTree/part/templates/part/category.html
index 03369b093d..48677ee71d 100644
--- a/InvenTree/part/templates/part/category.html
+++ b/InvenTree/part/templates/part/category.html
@@ -20,15 +20,37 @@
{% include "admin_button.html" with url=url %}
{% endif %}
{% if category %}
-{% if roles.part_category.change %}
-