|
a/Allura/allura/model/discuss.py |
|
b/Allura/allura/model/discuss.py |
|
... |
|
... |
494 |
security.simple_grant(
|
494 |
security.simple_grant(
|
495 |
self.acl, author.project_role()._id, 'unmoderated_post')
|
495 |
self.acl, author.project_role()._id, 'unmoderated_post')
|
496 |
g.post_event('discussion.new_post', self.thread_id, self._id)
|
496 |
g.post_event('discussion.new_post', self.thread_id, self._id)
|
497 |
artifact = self.thread.artifact or self.thread
|
497 |
artifact = self.thread.artifact or self.thread
|
498 |
n = Notification.post(artifact, 'message', post=self, file_info=file_info)
|
498 |
n = Notification.post(artifact, 'message', post=self, file_info=file_info)
|
499 |
if hasattr(self.discussion,"monitoring_email") and self.discussion.monitoring_email:
|
499 |
if hasattr(self.artifact,"monitoring_email") and self.artifact.monitoring_email:
|
500 |
n.send_simple(self.discussion.monitoring_email)
|
500 |
n.send_simple(self.artifact.monitoring_email)
|
501 |
session(self).flush()
|
501 |
session(self).flush()
|
502 |
self.thread.last_post_date = max(
|
502 |
self.thread.last_post_date = max(
|
503 |
self.thread.last_post_date,
|
503 |
self.thread.last_post_date,
|
504 |
self.mod_date)
|
504 |
self.mod_date)
|
505 |
self.thread.update_stats()
|
505 |
self.thread.update_stats()
|
506 |
self.discussion.update_stats()
|
506 |
self.artifact.update_stats()
|
507 |
g.director.create_activity(author, 'posted', self, target=artifact,
|
507 |
g.director.create_activity(author, 'posted', self, target=artifact,
|
508 |
related_nodes=[self.app_config.project])
|
508 |
related_nodes=[self.app_config.project])
|
509 |
|
509 |
|
510 |
def spam(self):
|
510 |
def spam(self):
|
511 |
self.status = 'spam'
|
511 |
self.status = 'spam'
|