app/models/openstax/accounts/group_nesting.rb in openstax_accounts-6.1.5 vs app/models/openstax/accounts/group_nesting.rb in openstax_accounts-6.1.6

- old
+ new

@@ -36,18 +36,19 @@ # Returns false if the update fails (aborting the save transaction) UpdateGroupCaches.call(self).errors.none? end def create_openstax_accounts_group_nesting - return false unless requestor + return false if requestor.nil? || requestor.is_anonymous? - OpenStax::Accounts::Api.create_group_nesting(requestor, self) + OpenStax::Accounts::Api.create_group_nesting(requestor, self) if requestor.has_authenticated? end def destroy_openstax_accounts_group_nesting - return false unless requestor + return false if requestor.nil? || requestor.is_anonymous? - OpenStax::Accounts::Api.destroy_group_nesting(requestor, self) + OpenStax::Accounts::Api.destroy_group_nesting(requestor, self) \ + if requestor.has_authenticated? end end end