diff --git a/colab/accounts/auth.py b/colab/accounts/auth.py index 7224b15..1a63968 100644 --- a/colab/accounts/auth.py +++ b/colab/accounts/auth.py @@ -1,5 +1,3 @@ -import re - from django_browserid.auth import BrowserIDBackend, default_username_algo diff --git a/colab/accounts/management/commands/delete_invalid.py b/colab/accounts/management/commands/delete_invalid.py deleted file mode 100644 index 0335e98..0000000 --- a/colab/accounts/management/commands/delete_invalid.py +++ /dev/null @@ -1,42 +0,0 @@ - - -from django.db.models import F -from django.utils import timezone -from django.utils.translation import ugettext as _ -from django.core.management.base import BaseCommand, CommandError - - -from ...models import User - - -class Command(BaseCommand): - """Delete user accounts that have never logged in. - - Delete from database user accounts that have never logged in - and are at least 24h older. - - """ - - help = __doc__ - - def handle(self, *args, **kwargs): - seconds = timezone.timedelta(seconds=1) - now = timezone.now() - one_day_ago = timezone.timedelta(days=1) - - # Query for users that have NEVER logged in - # - # By default django sets the last_login as auto_now and then - # last_login is pretty much the same than date_joined - # (instead of null as I expected). Because of that we query - # for users which last_login is between date_joined - N and - # date_joined + N, where N is a small constant in seconds. - users = User.objects.filter(last_login__gt=(F('date_joined') - seconds), - last_login__lt=(F('date_joined') + seconds), - date_joined__lt=now-one_day_ago) - count = 0 - for user in users: - count += 1 - user.delete() - - print _(u'%(count)s users deleted.') % {'count': count} diff --git a/colab/accounts/views.py b/colab/accounts/views.py index 83d02e0..c6cbf84 100644 --- a/colab/accounts/views.py +++ b/colab/accounts/views.py @@ -167,8 +167,6 @@ def signup(request): mailman.update_subscription(user.email, mailing_lists) messages.success(request, _('Your profile has been created!')) - messages.warning(request, _('You must login to validated your profile. ' - 'Profiles not validated are deleted in 24h.')) return redirect('user_profile', username=user.username) -- libgit2 0.21.2