Verified Commit 610bc213 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Force general category to always be active

parent bb25aee1
......@@ -31,7 +31,9 @@ class DeviceViewSet(ModelViewSet):
pass
data = serializer.validated_data
if 'receive_category' in data and len(data['receive_category']) > 0:
serializer.save(user=self.request.user, language=language)
categories = data['receive_catogory'] + ['general']
serializer.save(user=self.request.user, language=language,
receive_category=categories)
else:
categories = [c.pk for c in Category.objects.all()]
serializer.save(user=self.request.user, language=language,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment