Allura/allura/model/discuss.py
def notify_moderators(self, post):
        ''' Notify moderators that a post needs approval [#2963] '''
        artifact = self.artifact or self
        subject = '[%s:%s] Moderation action required' % (
            c.project.shortname, c.app.config.options.mount_point)
        author = post.author()
        url = self.discussion_class().query.get(_id=self.discussion_id).url()
        text = ('The following submission requires approval at %s before '
                'it can be approved for posting:\n\n%s'
                % (h.absurl(url + 'moderate'), post.text))
        n = Notification(
            ref_id=artifact.index_id(),
            topic='message',
            link=artifact.url(),
            _id=artifact.url() + post._id,
            from_address=str(author._id) if author != User.anonymous()
            else None,
            reply_to_address=g.noreply,
            subject=subject,
            text=text,
            in_reply_to=post.parent_id,
            author_id=author._id,
            pubdate=datetime.utcnow())
        users = self.app_config.project.users()
        for u in users:
            if (has_access(self, 'moderate', u)
                and Mailbox.subscribed(user_id=u._id,
                                       app_config_id=post.app_config_id)):
                    n.send_direct(str(u._id))
 Notify moderators that a post needs approval [#2963] 
Notify moderators that a post needs approval [#2963]
Notify moderators that a post needs approval [ #2963 ]
def notify_moderators(self, post):
        artifact = self.artifact or self
        subject = '[%s:%s] Moderation action required' % (
            c.project.shortname, c.app.config.options.mount_point)
        author = post.author()
        url = self.discussion_class().query.get(_id=self.discussion_id).url()
        text = ('The following submission requires approval at %s before '
                'it can be approved for posting:\n\n%s'
                % (h.absurl(url + 'moderate'), post.text))
        n = Notification(
            ref_id=artifact.index_id(),
            topic='message',
            link=artifact.url(),
            _id=artifact.url() + post._id,
            from_address=str(author._id) if author != User.anonymous()
            else None,
            reply_to_address=g.noreply,
            subject=subject,
            text=text,
            in_reply_to=post.parent_id,
            author_id=author._id,
            pubdate=datetime.utcnow())
        users = self.app_config.project.users()
        for u in users:
            if (has_access(self, 'moderate', u)
                and Mailbox.subscribed(user_id=u._id,
                                       app_config_id=post.app_config_id)):
                    n.send_direct(str(u._id))
def notify_moderators ( self , post ) : artifact = self . artifact or self subject = '[%s:%s] Moderation action required' % ( c . project . shortname , c . app . config . options . mount_point ) author = post . author ( ) url = self . discussion_class ( ) . query . get ( _id = self . discussion_id ) . url ( ) text = ( 'The following submission requires approval at %s before ' 'it can be approved for posting:\n\n%s' % ( h . absurl ( url + 'moderate' ) , post . text ) ) n = Notification ( ref_id = artifact . index_id ( ) , topic = 'message' , link = artifact . url ( ) , _id = artifact . url ( ) + post . _id , from_address = str ( author . _id ) if author != User . anonymous ( ) else None , reply_to_address = g . noreply , subject = subject , text = text , in_reply_to = post . parent_id , author_id = author . _id , pubdate = datetime . utcnow ( ) ) users = self . app_config . project . users ( ) for u in users : if ( has_access ( self , 'moderate' , u ) and Mailbox . subscribed ( user_id = u . _id , app_config_id = post . app_config_id ) ) : n . send_direct ( str ( u . _id ) )
Notify moderators that a post needs approval [#2963]
Notify moderators that a post needs approval [ #2963 ]
''' Notify moderators that a post needs approval [#2963] '''
self
post