|
a/Allura/allura/model/discuss.py |
|
b/Allura/allura/model/discuss.py |
1 |
import logging
|
1 |
import logging
|
|
|
2 |
import urllib
|
2 |
|
3 |
|
3 |
import tg
|
4 |
import tg
|
4 |
import pymongo
|
5 |
import pymongo
|
5 |
from pylons import c, g
|
6 |
from pylons import c, g
|
6 |
|
7 |
|
|
... |
|
... |
378 |
self.author().url(), self.author().display_name,
|
379 |
self.author().url(), self.author().display_name,
|
379 |
h.ago(self.timestamp))
|
380 |
h.ago(self.timestamp))
|
380 |
|
381 |
|
381 |
def url(self):
|
382 |
def url(self):
|
382 |
if self.thread:
|
383 |
if self.thread:
|
383 |
return self.thread.url() + self.slug + '/'
|
384 |
return self.thread.url() + urllib.quote_plus(self.slug) + '/'
|
384 |
else: # pragma no cover
|
385 |
else: # pragma no cover
|
385 |
return None
|
386 |
return None
|
386 |
|
387 |
|
387 |
def shorthand_id(self):
|
388 |
def shorthand_id(self):
|
388 |
if self.thread:
|
389 |
if self.thread:
|
|
... |
|
... |
459 |
discussion_id=post.discussion_id,
|
460 |
discussion_id=post.discussion_id,
|
460 |
app_config_id=post.app_config_id)
|
461 |
app_config_id=post.app_config_id)
|
461 |
|
462 |
|
462 |
def url(self):
|
463 |
def url(self):
|
463 |
if self.post_id:
|
464 |
if self.post_id:
|
464 |
return self.post.url() + 'attachment/' + self.filename
|
465 |
return self.post.url() + 'attachment/' + urllib.quote_plus(self.filename)
|
465 |
elif self.thread_id:
|
466 |
elif self.thread_id:
|
466 |
return self.thread.url() + 'attachment/' + self.filename
|
467 |
return self.thread.url() + 'attachment/' + urllib.quote_plus(self.filename)
|
467 |
else:
|
468 |
else:
|
468 |
return self.discussion.url() + 'attachment/' + self.filename
|
469 |
return self.discussion.url() + 'attachment/' + urllib.quote_plus(self.filename)
|
469 |
|
470 |
|
470 |
|
471 |
|