url_paginated works better than {{post.thread.artifact.url()}}#{{ post.slug }} in cases where the post is on page 2 or 3, etc. url_paginated isn't implemented for all artifacts, but it is for all posts, so make sure it works right... :)
instead of if h.has_access(value, 'read') or child.post.status == 'ok' it seems that we could just drop that whole if ... clause altogether. It seems like each post displays correctly based on its own status and we don't need to do a check at this level. (We don't have different actual permissions on posts, so the has_access always returns True if the visitor could view this page at all).
a test would be nice to cover this since its a bug. test_anonymous_post and test_thread would be good examples to work from
technically a separate issue, but I noticed it when testing this: there is a reply link on "Post awaiting moderation." posts which doesn't really make sense. It probably would be good to omit that (except for moderators/admins).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
url_paginated
works better than{{post.thread.artifact.url()}}#{{ post.slug }}
in cases where the post is on page 2 or 3, etc.url_paginated
isn't implemented for all artifacts, but it is for all posts, so make sure it works right... :)if h.has_access(value, 'read') or child.post.status == 'ok'
it seems that we could just drop that wholeif ...
clause altogether. It seems like each post displays correctly based on its own status and we don't need to do a check at this level. (We don't have different actual permissions on posts, so thehas_access
always returns True if the visitor could view this page at all).test_anonymous_post
andtest_thread
would be good examples to work fromMerge request updated.