Only return unique authorized_tools

This commit is contained in:
Tanner Collin 2019-05-23 12:42:17 -06:00
parent 77d961376e
commit 35c4ae4925

View File

@ -66,7 +66,7 @@ class ProfileSerializer(serializers.HyperlinkedModelSerializer):
fields = '__all__'
def get_authorized_tools(self, obj):
return [tool.slug for tool in models.Tool.objects.filter(course__profile=obj)]
return set([tool.slug for tool in models.Tool.objects.filter(course__profile=obj)])
class UserSerializer(serializers.ModelSerializer):
profile = ProfileSerializer(read_only=True)