Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)

src/d/j/django-two-factor-auth-HEAD/two_factor/views/profile.py   django-two-factor-auth(Download)
from django.views.decorators.cache import never_cache
from django.views.generic import TemplateView, FormView
from django_otp import user_has_device, devices_for_user
 
from ..forms import DisableForm
    def get(self, request, *args, **kwargs):
        if not user_has_device(self.request.user):
            return redirect(self.redirect_url or str(settings.LOGIN_REDIRECT_URL))
        return super(DisableView, self).get(request, *args, **kwargs)
 

src/d/j/django-two-factor-auth-0.5.0/two_factor/views/profile.py   django-two-factor-auth(Download)
from django.views.decorators.cache import never_cache
from django.views.generic import TemplateView, FormView
from django_otp import user_has_device, devices_for_user
 
from ..forms import DisableForm
    def get(self, request, *args, **kwargs):
        if not user_has_device(self.request.user):
            return redirect(self.redirect_url or str(settings.LOGIN_REDIRECT_URL))
        return super(DisableView, self).get(request, *args, **kwargs)
 

src/d/j/django-otp-0.2.7/django_otp/decorators.py   django-otp(Download)
from django.contrib.auth.decorators import user_passes_test
 
from django_otp import user_has_device
from django_otp.conf import settings
 
        login_url = settings.OTP_LOGIN_URL
 
    test = lambda user: user.is_verified() or (if_configured and user.is_authenticated() and not user_has_device(user))
    decorator = user_passes_test(test, login_url=login_url, redirect_field_name=redirect_field_name)
 

src/r/a/RatticWeb-HEAD/staff/views.py   RatticWeb(Download)
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils.translation import ugettext as _
from django_otp import user_has_device, devices_for_user
from django.core.files.uploadedfile import SimpleUploadedFile
 
        'credlogs': credlogs,
        'morelink': morelink,
        'hastoken': user_has_device(user)})