diff --git a/authentic2/setup.py b/authentic2/setup.py index 15df8e1..cc3a896 100755 --- a/authentic2/setup.py +++ b/authentic2/setup.py @@ -60,7 +60,7 @@ setup(name='authentic2-auf', ], entry_points={ 'authentic2.plugin': [ - 'authentic2-auf= authentic2_auf:Plugin', + 'authentic2-auf=authentic2_auf:Plugin', ], }, ) diff --git a/authentic2/src/authentic2_auf/__init__.py b/authentic2/src/authentic2_auf/__init__.py index 5ef155d..9c9d643 100644 --- a/authentic2/src/authentic2_auf/__init__.py +++ b/authentic2/src/authentic2_auf/__init__.py @@ -60,3 +60,11 @@ class Plugin(object): - os.path.join(settings.STATIC_URL, 'authentic2/img/ok.png') ''' return [] + + def check_view_restrictions(self, request): + from auf.django.secretquestions.models import Answer + from django.db.models import Model + + if request.user.is_authenticated() and isinstance(request.user, Model) and \ + not Answer.objects.filter(user=request.user).exists(): + return 'authentic2-auf-secret-questions'