<commit_before># -#- coding: utf-8 -#-

from django.db import models
from django.utils.translation import ugettext_lazy as _

from leonardo.module.web.models import Widget


LOGIN_TYPE_CHOICES = (
    (1, _("Admin")),
    (2, _("Public")),
)


class UserLoginWidget(Widget):
    type = models.PositiveIntegerField(verbose_name=_(
        "type"), choices=LOGIN_TYPE_CHOICES, default=2)

    def get_context_data(self, request):

        context = super(UserLoginWidget, self).get_context_data(request)

        if 'next' in request.GET:
            context['next'] = request.GET['next']

        return context

    class Meta:
        abstract = True
        verbose_name = _("user login")
        verbose_name_plural = _("user logins")<commit_msg>Fix missing next in context.<commit_after># -#- coding: utf-8 -#-

from django.db import models
from django.utils.translation import ugettext_lazy as _

from leonardo.module.web.models import Widget


LOGIN_TYPE_CHOICES = (
    (1, _("Admin")),
    (2, _("Public")),
)


class UserLoginWidget(Widget):
    type = models.PositiveIntegerField(verbose_name=_(
        "type"), choices=LOGIN_TYPE_CHOICES, default=2)

    def get_context_data(self, request):

        context = super(UserLoginWidget, self).get_context_data(request)

        if 'next' in request.GET:
            context['next'] = request.GET['next']
        else:
            context['next'] = request.path

        return context

    class Meta:
        abstract = True
        verbose_name = _("user login")
        verbose_name_plural = _("user logins")
{'fraction_non_alphanumeric': 0.1197452229299363, 'fraction_numerical': 0.005095541401273885, 'mean_word_length': 3.0805194805194804, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7484133', 'n_tokens_mistral': 505, 'n_tokens_neox': 482, 'n_words': 110}