Mercurial > public > sg101
comparison gpp/forums/views/spam.py @ 562:98b373ca09f3
For bitbucket issue #3, ensure that changes to Profile, Post & Topic models
via the admin cause the search index to be updated.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 08 Feb 2012 18:58:57 -0600 |
parents | 2ff5f4c1476d |
children | 93f049a241ff |
comparison
equal
deleted
inserted
replaced
561:8f3b7f0d4d13 | 562:98b373ca09f3 |
---|---|
6 import textwrap | 6 import textwrap |
7 | 7 |
8 from django.contrib.auth.decorators import login_required | 8 from django.contrib.auth.decorators import login_required |
9 from django.core.urlresolvers import reverse | 9 from django.core.urlresolvers import reverse |
10 from django.http import HttpResponseRedirect | 10 from django.http import HttpResponseRedirect |
11 from django.http import HttpResponseForbidden | |
12 from django.shortcuts import get_object_or_404 | 11 from django.shortcuts import get_object_or_404 |
13 from django.shortcuts import render_to_response | 12 from django.shortcuts import render_to_response |
14 from django.template import RequestContext | 13 from django.template import RequestContext |
15 from django.contrib.auth.models import User | 14 from django.contrib.auth.models import User |
16 | 15 |
50 """ | 49 """ |
51 profile = user.get_profile() | 50 profile = user.get_profile() |
52 if user.is_active and profile.status == bio.models.STA_STRANGER: | 51 if user.is_active and profile.status == bio.models.STA_STRANGER: |
53 profile.status = bio.models.STA_ACTIVE | 52 profile.status = bio.models.STA_ACTIVE |
54 profile.status_date = datetime.datetime.now() | 53 profile.status_date = datetime.datetime.now() |
55 profile.save() | 54 profile.save(content_update=False) |
56 | 55 |
57 | 56 |
58 @login_required | 57 @login_required |
59 def spammer(request, post_id): | 58 def spammer(request, post_id): |
60 """This view allows moderators to deactivate spammer accounts.""" | 59 """This view allows moderators to deactivate spammer accounts.""" |