diff --git a/app/serializers/user_serializer.rb b/app/serializers/user_serializer.rb index 37dff62bb..6b32e83a1 100644 --- a/app/serializers/user_serializer.rb +++ b/app/serializers/user_serializer.rb @@ -2,6 +2,6 @@ class UserSerializer < ActiveModel::Serializer attributes :id, :name, :email, :locale, :ordergroup_name, :ordergroup_id def ordergroup_id - object.ordergroup.id + object.ordergroup ? object.ordergroup.id : -1 end end