Page MenuHomeSoftware Heritage

auth/views: Fix encrypted token retrieval with PostreSQL backend
ClosedPublic

Authored by anlambert on Fri, Apr 2, 12:19 PM.

Details

Summary

When using the PostgreSQL backend for django database, models.BinaryField
colums are typed to memoryview while they are typed to bytes with
SQLite backend.

So handle both token types to fix errors in production since the
move to PostgreSQL backend.

Diff Detail

Repository
rDWAPPS Web applications
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont accepted this revision.
This revision is now accepted and ready to land.Fri, Apr 2, 12:22 PM

Build is green

Patch application report for D5407 (id=19350)

Rebasing onto 731d21e164...

Current branch diff-target is up to date.
Changes applied before test
commit fe53dbee8e171e786ddc79ce60f39ad2fb288281
Author: Antoine Lambert <antoine.lambert@inria.fr>
Date:   Fri Apr 2 12:15:52 2021 +0200

    auth/views: Fix encrypted token retrieval with PostreSQL backend
    
    When using the PostgreSQL backend for django database, models.BinaryField
    colums are typed to memoryview while they are typed to bytes with
    SQLite backend.
    
    So handle both token types to fix errors in production since the
    move to PostgreSQL backend.

See https://jenkins.softwareheritage.org/job/DWAPPS/job/tests-on-diff/649/ for more details.