First time here? Check out the FAQ!

apg's profile - activity

2022-03-14 04:14:09 -0500 received badge Popular Question (source)
2020-06-12 06:15:09 -0500 received badge Famous Question (source)
2020-06-12 06:15:02 -0500 received badge Famous Question (source)
2020-05-13 03:50:14 -0500 received badge Notable Question (source)
2018-05-04 12:42:22 -0500 received badge Famous Question (source)
2016-07-14 00:41:47 -0500 received badge Popular Question (source)
2015-10-22 09:03:58 -0500 received badge Notable Question (source)
2015-10-22 09:03:58 -0500 received badge Popular Question (source)
2015-10-05 10:58:41 -0500 marked best answer Haystack's real time indexing causes errors

Adding the following line for real time indexing causes the errors below.

HAYSTACK_SIGNAL_PROCESSOR = 'askbot.search.haystack.signals.AskbotRealtimeSignalProcessor'

Any suggestions?

====================================================================== ERROR: test_load_full_object_description_works (askbot.tests.page_load_tests.CommandViewTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/4hou4ken/askbot/askbot/tests/page_load_tests.py", line 691, in test_load_full_object_description_works post = models.Post.objects.create_new_tag_wiki(post_params) File "/media/sf_Ubuntu/4hou4ken/askbot/askbot/models/post.py", line 188, in create_new_tag_wiki post_type = 'tag_wiki' File "/media/sf_Ubuntu/4hou4ken/askbot/askbot/models/post.py", line 235, in create_new parse_results = post.parse_and_save(author=author, is_private=is_private) File "/media/sf_Ubuntu/4hou4ken/askbot/askbot/models/post.py", line 529, in parse_and_save super(self.__class__, self).save(kwargs) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/django/db/models/base.py", line 463, in save self.save_base(using=using, force_insert=force_insert, force_update=force_update) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/django/db/models/base.py", line 565, in save_base created=(not record_exists), raw=raw, using=using) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 172, in send response = receiver(signal=self, sender=sender, **named) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/haystack/signals.py", line 47, in handle_save index.update_object(instance, using=using) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/haystack/indexes.py", line 266, in update_object backend.update(self, [instance]) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/haystack/backends/solr_backend.py", line 49, in update docs.append(index.full_prepare(obj))
File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/haystack/indexes.py", line 196, in full_prepare self.prepared_data = self.prepare(obj) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/haystack/indexes.py", line 187, in prepare self.prepared_data[field.index_fieldname] = field.prepare(obj) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/haystack/fields.py", line 223, in prepare return self.convert(super(IntegerField, self).prepare(obj)) File "/home/a/virtualenv/4hou4ken/local/lib/python2.7/site-packages/haystack/fields.py", line 97, in prepare raise SearchFieldError("The model '%s' has an empty model_attr '%s' and doesn't allow a default or null value." % (repr(obj), attr)) SearchFieldError: The model '<post:< p=""> </post:<>

some text

' has an empty model_attr 'thread' and doesn't allow a default or null value.

====================================================================== ERROR: test_save_object_description_works (askbot.tests.page_load_tests.CommandViewTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/4hou4ken/askbot/askbot/tests/page_load_tests.py", line 718, in test_save_object_description_works self.assertEqual(group.description.text, 'some description') AttributeError: 'NoneType' object has no attribute 'text'

---------------------------------------------------------------------- Ran 5 tests in 3.517s

FAILED (errors=2) Destroying test database for alias 'default' ('test_forum')...

2015-05-11 12:27:57 -0500 received badge Famous Question (source)
2014-12-08 03:22:46 -0500 received badge Popular Question (source)
2014-10-19 13:46:38 -0500 received badge Famous Question (source)
2014-09-05 13:21:08 -0500 received badge Famous Question (source)
2014-07-27 02:23:43 -0500 received badge Famous Question (source)
2014-01-30 17:30:42 -0500 answered a question welcome email for first time user

This is not a direct answer, but you may want to take a look at lines starting from 3536 in askbot/models/__init__.py

def greet_new_user(user, **kwargs):
"""sends welcome email to the newly created user
2014-01-30 15:23:13 -0500 commented question welcome email for first time user

If what you mean is the email you receive right after registration, then that is implemented. If that's not what you are looking for, could you clarify what you mean by "welcome email"?

2014-01-29 22:06:17 -0500 commented question Auto completion in the tags field does not work for Japanese characters

It's solr. Thanks.

2014-01-27 11:10:15 -0500 asked a question Auto completion in the tags field does not work for Japanese characters

It seems auto completion in the "tags" field does not work for Japanese characters. It would be nice if someone implements it. Alternatively, could you please give me some pointers to help me find where to work on in the source code. Thank you.

2014-01-25 01:51:14 -0500 received badge Necromancer ( source )
2014-01-24 21:01:37 -0500 answered a question Disable Google Analytics for administrators.

How about just using google opt-out browser plugin from Google? https://tools.google.com/dlpage/gaoptout

2014-01-22 11:01:05 -0500 answered a question Comment functionality breaks when disabling email alerts

The issue indeed was reproduced for me. A quick hack to fix this issue is to comment out the following six lines around 1666 in askbot/media/js/post.js

//        if (this._minorEditBox) {
//            this._minorEditBox.hide();
//      

//        if (this._minorEditBox) {
//            this._minorEditBox.show();
//        }

If you want to turn off email alerts, then minorEditBox is irrelevant and therefore seems to be safe to comment out.

2014-01-22 09:59:33 -0500 received badge Commentator
2014-01-22 09:59:33 -0500 commented question How come you can't sign in with Facebook?

I think Facebook login is actually implemented. You just need some extra setup in the setting page for Facebook.

2014-01-21 22:30:05 -0500 asked a question What do publish and unpublish mean?

These two terms, "publish" and "unpublish," appear in the development version of askbot. What do they mean?

To be more specific, these terms can be found at

askbot/templates/question/answer_controls.html

in the following lines:

{% trans %}unpublish{% endtrans %} {% else %} {% endif %}

2014-01-07 22:06:24 -0500 received badge Necromancer ( source )
2014-01-06 13:34:29 -0500 asked a question Showing the most popular tags is more useful?

I think this is by design, but related tags in the side bar shows low numbers of tags when someone first visits the site. Currently on askbot.org, for example, admin * 2, askbot * 2 and so on.

I think it may be more useful to show the most popular tags similar to http://askbot.org/en/tags/ page when no search query is given by a visitor.

What do you think?

2014-01-05 10:49:12 -0500 answered a question How to keep the Askbot database and it's contents in sync using GIT

If you rather want to use PostgreSQL instead of SQLite, then I think you can use hooks to run pg_dump and pg_restore to achieve the same thing.
I admit this is a bit more complicated than JSarcher suggested.
However, it may be handy, for example, if you happen to use PostgreSQL in production and you want to use PostgreSQL in development as well.

2014-01-05 07:37:43 -0500 asked a question [hide preview] not working if not signed in

When you are not signed in and start answering a question, you see [hide preview] text just above the preview area. But clicking on [hide preview] does not actually hide preview, which is confusing.

I came up with the following fix. In templates/question/javascript.html, I changed

    if ((askbot['data']['threadIsClosed'] === false) && askbot['data']['userIsAuthenticated']) {
        initEditor();
    }

to

if (askbot['data']['threadIsClosed'] === false) {
    initEditor();
}

Do you think this does not break other things?

2014-01-05 05:04:15 -0500 asked a question Are there javascript tests?

Are there any javascript tests already written? If so, where can I find them?

I am about to change javascript code inside "media" folder, and I do not want to break things.

2014-01-03 09:52:25 -0500 commented question Backup script for Askbot

How about integrating django-dbbackup? https://pypi.python.org/pypi/django-dbbackup</p<>>

2014-01-03 01:46:20 -0500 asked a question How can you create an admin?

I have installed Askbot and registered two users. Neither of them seems to be an admin because I do not see admin only features such as settings link at the top of the page. So do I really have no admin? If so, how can I create one?

I am sure that I only have two users and no one else because when I went into shell and printed out

User.objects.all()

I only get exactly two users neither of whom is an admin.

2014-01-02 20:09:51 -0500 commented answer LANGUAGE_CODE = 'ja' causes many test failures and errors

Thank you for the comment. It was my fault not to mention that I actually DID use Solr when I ran those tests. I manually tested search capability of Japanese texts and it is working as far as I can tell. All the failures and errors turn passes when I changed 'ja' to 'en'. However, I am concerned some failures or errors if any may be genuine in a sense that they really cause some real problems with language = 'ja'. It is difficult to distinguish those real failures and errors that are caused by the fact that "test cases being written for the English setup."

2014-01-02 05:40:54 -0500 asked a question LANGUAGE_CODE = 'ja' causes many test failures and errors

Changing LANGUAGE_CODE = 'en' to LANGUAGE_CODE = 'ja' in settings.py caused many failures and errors (I included failures at the end of this post) when I ran test askbot command.

I am thinking about a workaround to keep LANGUAGE_CODE = 'en' as is and translate the user interface directly inside html files in templates folder. Do you think this workaround works? What else do you suggest?

I guess using .po file together with LANGUAGE_CODE = 'ja' may be the best practice. However, because of those errors, I am hesitant to go this route and possibly end up tweaking the code to pass all the tests.

Any thoughts would be appreciated. Thank you.

====================================================================== FAIL: test_load_object_description_fails (askbot.tests.page_load_tests.CommandViewTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/page_load_tests.py", line 736, in test_load_object_description_fails self.assertEqual(title, 'Page not found') AssertionError: u'\u30da\u30fc\u30b8\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093' != 'Page not found'

====================================================================== FAIL: test_privatize_public_question (askbot.tests.question_views_tests.PrivateQuestionViewsTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/question_views_tests.py", line 90, in test_privatize_public_question self.assertFalse(models.Group.objects.get_global_group() in set(question.groups.all())) AssertionError: True is not false

====================================================================== FAIL: test_publish_private_question (askbot.tests.question_views_tests.PrivateQuestionViewsTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/question_views_tests.py", line 69, in test_publish_private_question self.assertTrue(models.Group.objects.get_global_group() in set(question.groups.all())) AssertionError: False is not true

====================================================================== FAIL: test_answer_question (askbot.tests.post_model_tests.ThreadRenderCacheUpdateTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/post_model_tests.py", line 547, in test_answer_question self.assertEqual(2, Post.objects.count()) AssertionError: 2 != 1

====================================================================== FAIL: test_edit_question (askbot.tests.post_model_tests.ThreadRenderCacheUpdateTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/post_model_tests.py", line 504, in test_edit_question self.assertTrue(thread.last_activity_at

question.added_at) AssertionError: False is not true

====================================================================== FAIL: test_retag_question (askbot.tests.post_model_tests.ThreadRenderCacheUpdateTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/post_model_tests.py", line 522, in test_retag_question self.assertItemsEqual(['tag1', 'tag2'], list(question.thread.tags.values_list('name', flat=True))) AssertionError: Element counts were not equal: First has 1, Second has 0: u'test' First has 0, Second has 1: 'tag1' First has 0, Second has 1: 'tag2'

====================================================================== FAIL: test_thread_summary_locmem_cache (askbot.tests.post_model_tests.ThreadRenderLowLevelCachingTests) ---------------------------------------------------------------------- Traceback (most recent call last):
File "/media/sf_Ubuntu/shihoushiken/askbot/askbot/tests/post_model_tests.py", line 370, in test_thread_summary_locmem_cache self.assertTrue(thread.summary_html_cached()) AssertionError: False is not true


2014-01-01 05:50:01 -0500 asked a question Running tests with Haystack leaves behind 1000+ indexes

Running tests with Haystack leaves behind 1000+ indexes in Solr which lead to low performance of the full text search. I am guessing that tearDown() or something may be useful to avoid this problem. I hope the Askbot team will solve this soon.

Here is some additional information that may be relevant. I turned on Haystack with Solr following the instructions at http://askbot.org/doc/solr.html I get "Ran 621 tests in 2048.910s" with all tests passing.

Update: Using @override_settings to remove 'haystack' from INSTALLED_APPS as follows did not work. I am suspecting @override_settings does not work with INSTALLED_APPS.

def remove_haystack(appTuple):
    appList = list(appTuple)
    appList.remove('haystack')
    return(tuple(appList))

@override_settings(INSTALLED_APPS=remove_haystack(settings.INSTALLED_APPS))
class OnScreenUpdateNotificationTests(TestCase):
# more codes
2013-11-10 17:12:17 -0500 received badge Enlightened ( source )
2013-11-10 17:12:17 -0500 received badge Good Answer ( source )
2013-10-23 01:18:55 -0500 received badge Famous Question (source)