def get_all_user_subscriptions(user):
 NotificationSubscription = apps.get_model('osf.NotificationSubscription')
 for notification_type in constants.NOTIFICATION_TYPES:
  query = NotificationSubscription.find(Q(notification_type, 'eq', user.pk))
  for subscription in query:
   (yield subscription)

def get_all_user_subscriptions ( user ) : NotificationSubscription = apps . get_model ( 'osf.NotificationSubscription' ) for notification_type in constants . NOTIFICATION_TYPES : query = NotificationSubscription . find ( Q ( notification_type , 'eq' , user . pk ) ) for subscription in query : ( yield subscription )
get all subscription objects that the user is subscribed to .