behaviors.py 文件源码

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

项目:lagendacommun 作者: ecreall 项目源码 文件源码
def start(self, context, request, appstruct, **kw):
        changepassword = appstruct['change_password']['changepassword']
        current_user_password = appstruct['change_password']['currentuserpassword']
        user = get_current()
        if changepassword and user.check_password(current_user_password):
            password = appstruct['change_password']['password']
            context.set_password(password)

        context.set_title()
        name = name_chooser(name=context.title)
        if not context.name.startswith(name):
            principals = find_service(getSite(), 'principals')
            context.name = name_chooser(principals['users'], name=name)

        context.modified_at = datetime.datetime.now(tz=pytz.UTC)
        context.reindex()
        request.registry.notify(ActivityExecuted(self, [context], user))
        return {}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号