DjangoBB

Django based forum engine

  • You are not logged in.

#1 Sept. 5, 2012 17:34:32

jedie
From: germany
Registered: 2012-07-12
Posts: 160
Reputation: +  2  -
Profile   Send e-mail  

search bugfixes...

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)


That is a “new topic in last 24h search”.

But i think it would be helpful to have a “updated topics in last 24h search”, isn't it?

Maybe have both searches?




Some of my Projects:
* Migrate phpBB to DjangoBB with django-phpBB3
* DjangoBB github repro and information about my changes
* PyLucid CMS written in Django: http://www.pylucid.org/

Edited jedie (Sept. 6, 2012 12:23:16)

Offline

#2 Sept. 5, 2012 17:54:58

jedie
From: germany
Registered: 2012-07-12
Posts: 160
Reputation: +  2  -
Profile   Send e-mail  

search bugfixes...

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':
...




Some of my Projects:
* Migrate phpBB to DjangoBB with django-phpBB3
* DjangoBB github repro and information about my changes
* PyLucid CMS written in Django: http://www.pylucid.org/

Offline

#3 Sept. 6, 2012 10:53:54

jedie
From: germany
Registered: 2012-07-12
Posts: 160
Reputation: +  2  -
Profile   Send e-mail  

search bugfixes...

Have create https://github.com/slav0nic/DjangoBB/pull/15/

I have update the pull request just now:

  • Add PostTrackingAdmin
  • Display only new posts and not all poste from “new topics”
  • makes the same for “show new posts” (which use PostTracking information)




Some of my Projects:
* Migrate phpBB to DjangoBB with django-phpBB3
* DjangoBB github repro and information about my changes
* PyLucid CMS written in Django: http://www.pylucid.org/

Offline

#4 Sept. 6, 2012 11:39:18

jedie
From: germany
Registered: 2012-07-12
Posts: 160
Reputation: +  2  -
Profile   Send e-mail  

search bugfixes...

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;
}
see: https://github.com/jedie/DjangoBB/commit/cfd425b0c97d3fe4c170dc3f831f141af6b8f14d

result:




Some of my Projects:
* Migrate phpBB to DjangoBB with django-phpBB3
* DjangoBB github repro and information about my changes
* PyLucid CMS written in Django: http://www.pylucid.org/

Edited jedie (Sept. 6, 2012 11:39:42)

Attachments:
attachment 2012-09-06 scrollbar in search post results 01.png (42.7 KB)

Offline

#5 Sept. 6, 2012 12:28:09

jedie
From: germany
Registered: 2012-07-12
Posts: 160
Reputation: +  2  -
Profile   Send e-mail  

search bugfixes...

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
request.user is a SimpleLazyObject

EDIT:
Solution: if not user.is_authenticated(): raise Http404
Bugfix in pull request: https://github.com/jedie/DjangoBB/commit/848dd4f6fc3bf654f297857222715ff80336c465




Some of my Projects:
* Migrate phpBB to DjangoBB with django-phpBB3
* DjangoBB github repro and information about my changes
* PyLucid CMS written in Django: http://www.pylucid.org/

Edited jedie (Sept. 6, 2012 12:31:07)

Offline

#6 Sept. 10, 2012 13:24:35

jedie
From: germany
Registered: 2012-07-12
Posts: 160
Reputation: +  2  -
Profile   Send e-mail  

search bugfixes...

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.




Some of my Projects:
* Migrate phpBB to DjangoBB with django-phpBB3
* DjangoBB github repro and information about my changes
* PyLucid CMS written in Django: http://www.pylucid.org/

Offline

#7 Oct. 25, 2012 14:19:43

jedie
From: germany
Registered: 2012-07-12
Posts: 160
Reputation: +  2  -
Profile   Send e-mail  

search bugfixes...

jedie
* 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
Revert this here: https://github.com/slav0nic/DjangoBB/pull/23

Because hidden posts would be exclude before.

TODO: Add a link in user list, too.




Some of my Projects:
* Migrate phpBB to DjangoBB with django-phpBB3
* DjangoBB github repro and information about my changes
* PyLucid CMS written in Django: http://www.pylucid.org/

Edited jedie (Oct. 25, 2012 14:20:29)

Offline

#8 Jan. 13, 2013 20:03:38

tzot
Registered: 2012-12-05
Posts: 5
Reputation: +  0  -
Profile   Send e-mail  

search bugfixes...

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 }}">
while I believe that
<td class="tcr"><a href="{{ topic.last_post.get_absolute_url }}">
would be more typical (less unexpected).

Offline

Board footer

Moderator control

Powered by DjangoBB

Lo-Fi Version