Setting Ownership of keys

This commit is contained in:
Mohamed ElKalioby
2019-10-16 14:41:19 +03:00
parent ed204c1d85
commit 9086f47456
6 changed files with 30 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('mfa', '0008_user_keys_last_used'),
]
operations = [
migrations.AddField(
model_name='user_keys',
name='owned_by_enterprise',
field=models.NullBooleanField(default=None),
),
migrations.RunSQL("update mfa_user_keys set owned_by_enterprise = %s where key_type='FIDO2'"%(1 if getattr(settings,"MFA_OWNED_BY_ENTERPRISE",False) else 0 ))
]