1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-01-12 16:35:17 +00:00
webvirtcloud/accounts/utils.py
2020-10-08 17:57:51 +06:00

9 lines
265 B
Python

from django_otp import devices_for_user
from django_otp.plugins.otp_totp.models import TOTPDevice
def get_user_totp_device(user):
devices = devices_for_user(user)
for device in devices:
if isinstance(device, TOTPDevice):
return device