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."""
    messages.info(request, _('Account created.  Welcome!'))
    return redirect('home')
