<commit_before>from django.shortcuts import render_to_response, redirect
from system.models import CustomUser
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import BaseUserManager
from django import forms
from system.controllers.postFinishView import finish


class RegisterForm(UserCreationForm):
    email = forms.EmailField(required=True)

    class Meta:
        model = CustomUser
        fields = ("username",)

    def clean_email(self):
        email = self.cleaned_data["email"]
        username = self.cleaned_data["username"]
        if email and CustomUser.objects.filter(email=email).exclude(username=username).count():
            raise forms.ValidationError("Email addresses must be unique.")
        return email


    def save(self, commit=True):
        print(" === save === ")
        user = super(RegisterForm, self).save(commit=False)
        user.email = BaseUserManager.normalize_email(
                self.cleaned_data["email"])
        if commit:
            user.save()
        return user
<commit_msg>pep8に従って修正<commit_after>from django.shortcuts import render_to_response, redirect
from system.models import CustomUser
from django.template import RequestContext
from django.core.urlresolvers import reverse
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import BaseUserManager
from django import forms
from system.controllers.postFinishView import finish


class RegisterForm(UserCreationForm):
    email = forms.EmailField(required=True)

    class Meta:
        model = CustomUser
        fields = ("username",)

    def clean_email(self):
        email = self.cleaned_data["email"]
        username = self.cleaned_data["username"]
        if email and CustomUser.objects.filter(
                email=email).exclude(username=username).count():
            raise forms.ValidationError("Email addresses must be unique.")
        return email

    def save(self, commit=True):
        print(" === save === ")
        user = super(RegisterForm, self).save(commit=False)
        user.email = BaseUserManager.normalize_email(
                self.cleaned_data["email"])
        if commit:
            user.save()
        return user

{'fraction_non_alphanumeric': 0.0893854748603352, 'fraction_numerical': 0.0004297378599054577, 'mean_word_length': 3.2715596330275227, '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': '4313637', 'n_tokens_mistral': 609, 'n_tokens_neox': 589, 'n_words': 155}