Ajoute une restriction de vue sur la vue d'initialisation des questions secrètes
This commit is contained in:
parent
27bc7dd3d6
commit
2733ba5064
|
@ -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'
|
||||
|
|
Reference in New Issue