<commit_before>from django.db import connection, models
from django.db.models.signals import post_save, post_syncdb
from django.contrib.auth.models import (
    AbstractBaseUser, BaseUserManager, PermissionsMixin)
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.conf import settings

from vumi.persist.riak_manager import RiakManager
from go.vumitools.account import AccountStore
from go.base.utils import vumi_api_for_user


def get_account_store():
    return AccountStore(RiakManager.from_config(
            settings.VUMI_API_CONFIG['riak_manager']))


class GoUserManager(BaseUserManager):
    def _create_user(self, email, password, **kw):
        if not email:
            raise ValueError('Users must have an email address')
        email = self.normalize_email(email)
        user = self.model(email=email, password=password, **kw)
        user.set_password(password)
        user.save(using=self._db)<commit_msg>Remove double setting of password.<commit_after>from django.db import connection, models
from django.db.models.signals import post_save, post_syncdb
from django.contrib.auth.models import (
    AbstractBaseUser, BaseUserManager, PermissionsMixin)
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.conf import settings

from vumi.persist.riak_manager import RiakManager
from go.vumitools.account import AccountStore
from go.base.utils import vumi_api_for_user


def get_account_store():
    return AccountStore(RiakManager.from_config(
            settings.VUMI_API_CONFIG['riak_manager']))


class GoUserManager(BaseUserManager):
    def _create_user(self, email, password, **kw):
        if not email:
            raise ValueError('Users must have an email address')
        email = self.normalize_email(email)
        user = self.model(email=email, **kw)
        user.set_password(password)
        user.save(using=self._db)
{'fraction_non_alphanumeric': 0.07830092118730808, 'fraction_numerical': 0.0, 'mean_word_length': 4.3856749311294765, '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': '4355810', 'n_tokens_mistral': 565, 'n_tokens_neox': 561, 'n_words': 144}