'before get method for user object
:param view_kwargs:
:return:'

def before_get_object(self, view_kwargs):

    if (view_kwargs.get('notification_id') is not None):
        notification = safe_query(self, Notification, 'id', view_kwargs['notification_id'], 'notification_id')
        if (notification.user_id is not None):
            view_kwargs['id'] = notification.user_id
        else:
            view_kwargs['id'] = None
    if (view_kwargs.get('event_invoice_id') is not None):
        event_invoice = safe_query(self, EventInvoice, 'id', view_kwargs['event_invoice_id'], 'event_invoice_id')
        if (event_invoice.user_id is not None):
            view_kwargs['id'] = event_invoice.user_id
        else:
            view_kwargs['id'] = None
    if (view_kwargs.get('users_events_role_id') is not None):
        users_events_role = safe_query(self, UsersEventsRoles, 'id', view_kwargs['users_events_role_id'], 'users_events_role_id')
        if (users_events_role.user_id is not None):
            view_kwargs['id'] = users_events_role.user_id
    if (view_kwargs.get('speaker_id') is not None):
        speaker = safe_query(self, Speaker, 'id', view_kwargs['speaker_id'], 'speaker_id')
        if (speaker.user_id is not None):
            view_kwargs['id'] = speaker.user_id
        else:
            view_kwargs['id'] = None
    if (view_kwargs.get('access_code_id') is not None):
        access_code = safe_query(self, AccessCode, 'id', view_kwargs['access_code_id'], 'access_code_id')
        if (access_code.marketer_id is not None):
            view_kwargs['id'] = access_code.marketer_id
        else:
            view_kwargs['id'] = None
    if (view_kwargs.get('discount_code_id') is not None):
        discount_code = safe_query(self, DiscountCode, 'id', view_kwargs['discount_code_id'], 'discount_code_id')
        if (discount_code.marketer_id is not None):
            view_kwargs['id'] = discount_code.marketer_id
        else:
            view_kwargs['id'] = None
    if (view_kwargs.get('email_notification_id') is not None):
        email_notification = safe_query(self, EmailNotification, 'id', view_kwargs['email_notification_id'], 'email_notification_id')
        if (email_notification.user_id is not None):
            view_kwargs['id'] = email_notification.user_id
        else:
            view_kwargs['id'] = None
