Example #1
0
def update_receiver_settings(store, receiver_id, request, language):
    db_user_update_user(store, receiver_id, request)

    receiver, user = models.db_get(store, (models.Receiver, models.User),
                                   models.Receiver.id == receiver_id,
                                   models.User.id == receiver_id)

    receiver.tip_notification = request['tip_notification']

    return receiver_serialize_receiver(store, receiver, user, language)
Example #2
0
def update_receiver_settings(session, state, tid, receiver_id, request, language):
    db_user_update_user(session, state, tid, receiver_id, request)

    receiver, user = session.query(models.Receiver, models.User). \
                           filter(models.Receiver.id == receiver_id,
                                  models.User.id == receiver_id,
                                  models.User.tid == tid).one_or_none()

    receiver.tip_notification = request['tip_notification']

    return receiver_serialize_receiver(session, tid, receiver, user, language)
Example #3
0
def update_receiver_settings(store, receiver_id, request, language):
    user = db_user_update_user(store, receiver_id, request, language)
    if not user:
        raise errors.UserIdNotFound

    receiver = store.find(Receiver, Receiver.id == receiver_id).one()
    if not receiver:
        raise errors.ReceiverIdNotFound

    receiver.tip_notification = request['tip_notification']

    return receiver_serialize_receiver(receiver, language)
Example #4
0
def update_receiver_settings(store, receiver_id, request, language):
    user = db_user_update_user(store, receiver_id, request, language)
    if not user:
        raise errors.UserIdNotFound

    receiver = store.find(Receiver, Receiver.id == receiver_id).one()
    if not receiver:
        raise errors.ReceiverIdNotFound

    receiver.tip_notification = request["tip_notification"]

    return receiver_serialize_receiver(receiver, language)
Example #5
0
def update_receiver_settings(store, receiver_id, request, language):
    user = db_user_update_user(store, receiver_id, request, language)
    if not user:
        raise errors.UserIdNotFound

    receiver = store.find(Receiver, Receiver.id == receiver_id).one()
    if not receiver:
        raise errors.ReceiverIdNotFound

    ping_mail_address = request['ping_mail_address']
    if ping_mail_address != receiver.ping_mail_address:
        log.info("Ping email going to be updated, %s => %s" % (
            receiver.ping_mail_address, ping_mail_address))
        receiver.ping_mail_address = ping_mail_address

    receiver.tip_notification = request['tip_notification']
    receiver.ping_notification = request['ping_notification']

    return receiver_serialize_receiver(receiver, language)
Example #6
0
def update_receiver_settings(session, tid, user_session, request, language):
    user = db_user_update_user(session, tid, user_session, request)

    return receiver_serialize_receiver(session, tid, user, language)
Example #7
0
def update_receiver_settings(session, tid, user_session, request, language):
    user = db_user_update_user(session, tid, user_session, request)

    return receiver_serialize_receiver(session, tid, user, language)