Django based forum engine
2
discussion about http://djangobb.org/ticket/234
The ‘show_24h’ search query would be build with:
if action == 'show_24h': date = datetime.today() - timedelta(1) topics = topics.filter(created__gte=date)

Edited jedie (Sept. 6, 2012 12:23:16)
Offline
2
A solution would be:
if action == 'show_24h': date = datetime.now() - timedelta(days=1) topics = topics.filter(Q(last_post__created__gte=date) | Q(last_post__updated__gte=date)) elif action == 'show_new': ...
Offline
2
Have create https://github.com/slav0nic/DjangoBB/pull/15/
I have update the pull request just now:
Offline
2
I add another small enhancement: I change CSS and add:
div.searchposts div.postmsg { /* add scoll bars on small postmsg in search results */ overflow:auto; }
Edited jedie (Sept. 6, 2012 11:39:42)
Attachments:
2012-09-06 scrollbar in search post results 01.png (42.7 KB)
Offline
2
Found another bug in search:
I get a 500 if anonymous user request search/?action=show_new:
TypeError: int() argument must be a string or a number, not ‘SimpleLazyObject’The problem is here:
last_read = PostTracking.objects.get(user=request.user).last_read
Edited jedie (Sept. 6, 2012 12:31:07)
Offline
2
Found some security related issues in search, today and fix them:
* Anonymous user can search posts from other users fixed with https://github.com/jedie/DjangoBB/commit/2a4425dfd42f6931fc0a1e7f6a6bf9c3843c97cc
1. Now only staff members can add &user_id=XXX to the url
2. Anonymous users can't use ‘show_user’ search any more and get a Http404
* Search results doesn't hide hits in not accessible categories. This have i fixed with: https://github.com/jedie/DjangoBB/commit/1a01a43d86678d8d61c81eb6bdf0b91537c751e5
Other non security related changes are:
* Display the hit count of a search and a message
* don't filter by category groups for superusers
* optimized queryset in “show your topics” search view and bugfix in search result order.
Offline
2
jedieRevert this here: https://github.com/slav0nic/DjangoBB/pull/23
* Anonymous user can search posts from other users fixed with https://github.com/jedie/DjangoBB/commit/2a4425dfd42f6931fc0a1e7f6a6bf9c3843c97cc
1. Now only staff members can add &user_id=XXX to the url
2. Anonymous users can't use ‘show_user’ search any more and get a Http404
Edited jedie (Oct. 25, 2012 14:20:29)
Offline
0
I have djangobb_forum-0.0.1a0 installed. I made a change in templates/search_topics.html in line 83: as a search result, it showed by default
<td class="tcr"><a href="{{ topic.get_absolute_url }}"><td class="tcr"><a href="{{ topic.last_post.get_absolute_url }}">Offline