Skip to content

Commit

Permalink
Remove totpdevice annotation (#3342)
Browse files Browse the repository at this point in the history
No longer used after migrating to built in 2FA.
  • Loading branch information
jmsmkn authored May 3, 2024
1 parent 0233c26 commit 3de2456
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions app/grandchallenge/profiles/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.db.models import Count, Q

from grandchallenge.core.admin import (
GroupObjectPermissionAdmin,
Expand Down Expand Up @@ -52,17 +51,6 @@ class UserProfileAdmin(UserAdmin):
)
actions = (deactivate_users,)

def get_queryset(self, request):
return (
super()
.get_queryset(request)
.annotate(
totp_device_count=Count(
"totpdevice", filter=Q(totpdevice__confirmed=True)
)
)
)

@admin.display(boolean=True, description="User has 2FA enabled")
def has_2fa_enabled(self, obj):
return is_mfa_enabled(obj)
Expand Down

0 comments on commit 3de2456

Please sign in to comment.