helpers.py 文件源码

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

项目:pep8speaks 作者: OrkoHunter 项目源码 文件源码
def update_users(repository):
    """Update users of the integration in the database"""
    if os.environ.get("OVER_HEROKU", False) is not False:
        # Check if repository exists in database
        query = r"INSERT INTO Users (repository, created_at) VALUES ('{}', now());" \
                "".format(repository)

        # cursor and conn are bultins, defined in app.py
        try:
            cursor.execute(query)
            conn.commit()
        except psycopg2.IntegrityError:  # If already exists
            conn.rollback()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号