Ajoute une restriction de vue sur la vue d'initialisation des questions secrètes
This commit is contained in:
parent
27bc7dd3d6
commit
2733ba5064
|
@ -60,7 +60,7 @@ setup(name='authentic2-auf',
|
||||||
],
|
],
|
||||||
entry_points={
|
entry_points={
|
||||||
'authentic2.plugin': [
|
'authentic2.plugin': [
|
||||||
'authentic2-auf= authentic2_auf:Plugin',
|
'authentic2-auf=authentic2_auf:Plugin',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -60,3 +60,11 @@ class Plugin(object):
|
||||||
- os.path.join(settings.STATIC_URL, 'authentic2/img/ok.png')
|
- os.path.join(settings.STATIC_URL, 'authentic2/img/ok.png')
|
||||||
'''
|
'''
|
||||||
return []
|
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