Commit 4242f595 authored by mgabdev's avatar mgabdev

Updated group_serializer to account for no current_user

• Updated:
- group_serializer to account for no current_user
parent b124a502
......@@ -16,7 +16,7 @@ class REST::GroupSerializer < ActiveModel::Serializer
end
def password
if object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
if current_user && object.group_accounts.where(account_id: current_user.account.id, role: :admin).exists?
object.password
else
nil
......
Markdown is supported
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