Skip to content

Commit

Permalink
add type checking for node notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Johnetordoff committed Jan 23, 2025
1 parent 222a0fa commit e05483d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/institutions/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from website import mails
from rest_framework import exceptions

from api.base.serializers import relationship_diff
from osf.models import Institution
from osf.models import Institution, Node
from osf.utils import permissions as osf_permissions


Expand Down Expand Up @@ -38,8 +39,7 @@ def update_institutions(resource, new_institutions, user, post=False, notify=Tru
raise exceptions.PermissionDenied(detail=f'User needs to be affiliated with {inst.name}')
resource.add_affiliated_institution(inst, user)

if notify:
from website import mails
if notify and isinstance(resource, Node):

for user in resource.get_admin_contributors_recursive(unique_users=True):
mails.send_mail(
Expand Down

0 comments on commit e05483d

Please sign in to comment.