Commit e80461abcbe8bbd6b7ad9dd5a4b87fb4bc309fbb
Committed by
Sergio Oliveira
1 parent
0df063b2
Exists in
master
and in
39 other branches
Removed message to validate profile
Message is not necessary anymore since browserid itself validates the emails the users register, also deleted script to delete invalid emails since browserid is already validating the emails. Signed-off-by: Carlos Oliveira <carlospecter@gmail.com> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Showing
3 changed files
with
0 additions
and
46 deletions
Show diff stats
colab/accounts/auth.py
colab/accounts/management/commands/delete_invalid.py
... | ... | @@ -1,42 +0,0 @@ |
1 | - | |
2 | - | |
3 | -from django.db.models import F | |
4 | -from django.utils import timezone | |
5 | -from django.utils.translation import ugettext as _ | |
6 | -from django.core.management.base import BaseCommand, CommandError | |
7 | - | |
8 | - | |
9 | -from ...models import User | |
10 | - | |
11 | - | |
12 | -class Command(BaseCommand): | |
13 | - """Delete user accounts that have never logged in. | |
14 | - | |
15 | - Delete from database user accounts that have never logged in | |
16 | - and are at least 24h older. | |
17 | - | |
18 | - """ | |
19 | - | |
20 | - help = __doc__ | |
21 | - | |
22 | - def handle(self, *args, **kwargs): | |
23 | - seconds = timezone.timedelta(seconds=1) | |
24 | - now = timezone.now() | |
25 | - one_day_ago = timezone.timedelta(days=1) | |
26 | - | |
27 | - # Query for users that have NEVER logged in | |
28 | - # | |
29 | - # By default django sets the last_login as auto_now and then | |
30 | - # last_login is pretty much the same than date_joined | |
31 | - # (instead of null as I expected). Because of that we query | |
32 | - # for users which last_login is between date_joined - N and | |
33 | - # date_joined + N, where N is a small constant in seconds. | |
34 | - users = User.objects.filter(last_login__gt=(F('date_joined') - seconds), | |
35 | - last_login__lt=(F('date_joined') + seconds), | |
36 | - date_joined__lt=now-one_day_ago) | |
37 | - count = 0 | |
38 | - for user in users: | |
39 | - count += 1 | |
40 | - user.delete() | |
41 | - | |
42 | - print _(u'%(count)s users deleted.') % {'count': count} |
colab/accounts/views.py
... | ... | @@ -167,8 +167,6 @@ def signup(request): |
167 | 167 | mailman.update_subscription(user.email, mailing_lists) |
168 | 168 | |
169 | 169 | messages.success(request, _('Your profile has been created!')) |
170 | - messages.warning(request, _('You must login to validated your profile. ' | |
171 | - 'Profiles not validated are deleted in 24h.')) | |
172 | 170 | |
173 | 171 | return redirect('user_profile', username=user.username) |
174 | 172 | ... | ... |