controller.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:chronophore 作者: mesbahamin 项目源码 文件源码
def sign_out(entry, time_out=None, forgot=False):
    """Sign out of an existing entry in the timesheet. If the user
    forgot to sign out, flag the entry.

    :param entry: `models.Entry` object. The entry to sign out.
    :param time_out: (optional) `datetime.time` object. Specify the sign out time.
    :param forgot: (optional) If true, user forgot to sign out. Entry will be flagged as forgotten.
    :return: The signed out entry.
    """ # noqa
    if time_out is None:
        time_out = datetime.today().time()

    if forgot:
        entry.forgot_sign_out = True
        logger.info(
            '{} forgot to sign out on {}.'.format(entry.user_id, entry.date)
        )

    else:
        entry.time_out = time_out

    logger.info('{} ({}) signed out.'.format(entry.user_id, entry.user_type))
    return entry
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号