2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 20:45:44 +00:00

remove old catch

This commit is contained in:
Matthias Mair
2024-04-08 21:31:55 +02:00
parent 08bb8510fe
commit 432dbf78a8

View File

@ -2,7 +2,7 @@
import base64
from django.db import OperationalError, migrations
from django.db import migrations
from allauth.mfa.adapter import get_adapter
from allauth.mfa.models import Authenticator
@ -13,13 +13,6 @@ from django_otp.plugins.otp_totp.models import TOTPDevice
def move_mfa(apps, schema_editor):
"""Data migration to switch to django-allauth's new built-in MFA."""
adapter = get_adapter()
try:
TOTPDevice.objects.all().count()
except OperationalError:
# The table may not exist
print('Skipping totp migration as model does not exist')
return
authenticators = []
for totp in TOTPDevice.objects.filter(confirmed=True).iterator():
recovery_codes = set()