27509d25bfac6b9a2af0556d936819de47b6edd0 — Adnan Maolood 4 months ago 030a0cd master 0.69.7
srht/oauth: Use canonical user IDs

When adding users to the database, use the canonical user ID from
1 files changed, 4 insertions(+), 3 deletions(-)

M srht/oauth/interface.py
M srht/oauth/interface.py => srht/oauth/interface.py +4 -3
@@ 151,16 151,17 @@ If you are the admin of {metasrht}, run the following SQL to correct this:
        # I hate SQLAlchemy SO FUCKING MUCH
        results = db.engine.execute(text("""
            INSERT INTO "user" (
                created, updated, username, email, user_type, url, location,
                created, updated, id, username, email, user_type, url, location,
                bio, suspension_notice
            ) VALUES (
                NOW() at time zone 'utc',
                NOW() at time zone 'utc',
                :name, :email, :user_type, :url, :location, :bio, :suspension_notice
                :id, :name, :email, :user_type, :url, :location, :bio, :suspension_notice
            ON CONFLICT (username)
            ON CONFLICT (id)
            DO UPDATE SET
                updated = NOW() at time zone 'utc',
                username = :name,
                email = :email,
                user_type = :user_type,
                url = :url,