Mercurial > public > sg101
comparison accounts/__init__.py @ 690:988782c6ce6c
For #48, rework blocking code to use fail2ban.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 01 Sep 2013 00:15:42 -0500 |
parents | ee87ea74d46b |
children |
comparison
equal
deleted
inserted
replaced
689:a8dc08cc5db4 | 690:988782c6ce6c |
---|---|
1 import datetime | 1 import datetime |
2 import logging | 2 import logging |
3 | 3 |
4 from django.contrib.auth.models import User | 4 from django.contrib.auth.models import User |
5 | |
6 | |
7 logger = logging.getLogger('auth') | |
5 | 8 |
6 | 9 |
7 def create_new_user(pending_user, ip=None, admin_activation=False): | 10 def create_new_user(pending_user, ip=None, admin_activation=False): |
8 """ | 11 """ |
9 This function contains the code to create a new user from a | 12 This function contains the code to create a new user from a |
32 msg = 'Accounts registration confirmed by ADMIN for %s' % new_user.username | 35 msg = 'Accounts registration confirmed by ADMIN for %s' % new_user.username |
33 else: | 36 else: |
34 msg = 'Accounts registration confirmed by USER for %s from %s' % ( | 37 msg = 'Accounts registration confirmed by USER for %s from %s' % ( |
35 new_user.username, ip) | 38 new_user.username, ip) |
36 | 39 |
37 logging.info(msg) | 40 logger.info(msg) |