Commit e2d2daa2 authored by Tom van Bussel's avatar Tom van Bussel
Browse files

Merge branch 'feature/force-general-category' into 'master'

Force general category

See merge request thalia/concrexit!833
parents b5a52413 610bc213
......@@ -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