allow guest login
This commit is contained in:
@ -20,10 +20,11 @@ from dashboard.views import dashboard
|
||||
from lazysignup.views import convert
|
||||
|
||||
from .forms import UserCreationForm
|
||||
from .views import lazy_convert_done
|
||||
from .views import login_guest, lazy_convert_done
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
path('guest', login_guest, name='login_guest'),
|
||||
path('', dashboard, name='home'),
|
||||
path('dashboard', dashboard, name='dashboard'),
|
||||
path('admin/', admin.site.urls),
|
||||
|
||||
@ -2,6 +2,16 @@ from django.shortcuts import redirect
|
||||
from django.contrib import messages
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from lazysignup.decorators import allow_lazy_user
|
||||
from account.decorators import login_required
|
||||
|
||||
|
||||
@allow_lazy_user
|
||||
def login_guest(request):
|
||||
"""Create a lazy user if necessary and redirect."""
|
||||
messages.info(request, _('Welcome, guest!'))
|
||||
return redirect('home')
|
||||
|
||||
|
||||
def lazy_convert_done(request):
|
||||
"""Called after converting a lazy user."""
|
||||
|
||||
Reference in New Issue
Block a user