def get_email_preferences(user_id):
 email_preferences_model = user_models.UserEmailPreferencesModel.get(user_id, strict=False)
 if (email_preferences_model is None):
  return user_domain.UserGlobalPrefs.create_default_prefs()
 else:
  return user_domain.UserGlobalPrefs(email_preferences_model.site_updates, email_preferences_model.editor_role_notifications, email_preferences_model.feedback_message_notifications, email_preferences_model.subscription_notifications)

def get_email_preferences ( user_id ) : email_preferences_model = user_models . UserEmailPreferencesModel . get ( user_id , strict = False ) if ( email_preferences_model is None ) : return user_domain . UserGlobalPrefs . create_default_prefs ( ) else : return user_domain . UserGlobalPrefs ( email_preferences_model . site_updates , email_preferences_model . editor_role_notifications , email_preferences_model . feedback_message_notifications , email_preferences_model . subscription_notifications )
gives email preferences of user with given user_id .