Commit 984f8dce authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: fix db migration

Migration 0066 should not run on a fresh installation.
parent e8bc8a17
......@@ -123,19 +123,22 @@ class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
for backend in orm.Backend.objects.all():
old_pass = decrypt_db_charfield_old(backend.password_hash)
old_hash = backend.password_hash
if len(old_hash.split(":")) == 2:
old_pass = decrypt_db_charfield_old(old_hash)
new_hash = encrypt_db_charfield(old_pass)
# Bypass save method!
def backwards(self, orm):
"Write your backwards methods here."
for backend in orm.Backend.objects.all():
old_pass = decrypt_db_charfield(backend.password_hash)
new_hash = encrypt_db_charfield_old(old_pass)
models = {
'db.backend': {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment