~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to pybb/management/commands/send_hidden_post_mail.py

  • Committer: franku
  • Author(s): GunChleoc
  • Date: 2016-12-13 18:30:38 UTC
  • mfrom: (438.1.6 pyformat_util)
  • Revision ID: somal@arcor.de-20161213183038-5cgmvfh2fkgmoc1s
adding a script to run pyformat over the code base

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from django.conf import settings
5
5
from django.contrib.sites.models import Site
6
6
 
 
7
 
7
8
class Command(BaseCommand):
8
9
    help = 'Send emails if hidden posts are found'
9
10
 
13
14
        if hidden_posts:
14
15
            message = 'There were %d hidden posts found:' % len(hidden_posts)
15
16
            for post in hidden_posts:
16
 
                message += '\n' + post.user.username + ': ' + post.body_text[:70]
 
17
                message += '\n' + post.user.username + \
 
18
                    ': ' + post.body_text[:70]
17
19
 
18
20
            message += '\n\nAdmin page: ' + Site.objects.get_current().domain + \
19
21
                '/admin/pybb/post/'