def run(): """runs all the startup procedures""" run_startup_tests() try: badges.init_badges() transaction.commit() except: transaction.rollback()
def ready(self): from askbot.models import badges try: badges.init_badges() except: pass import followit user_model = get_user_model() followit.register(user_model)
def init_badges_once(sender, **kwargs): from askbot.models import badges global BADGES_READY if not BADGES_READY: try: badges.init_badges() except: pass else: BADGES_READY = True
'message': 'Please replace setting ASKBOT_FILE_UPLOAD_DIR ', 'replace_hint': "with MEDIA_ROOT = '%s'" }, 'ASKBOT_UPLOADED_FILES_URL': { 'test_for_absence': True, 'message': 'Please replace setting ASKBOT_UPLOADED_FILES_URL ', 'replace_hint': "with MEDIA_URL = '/%s'" } }) settings_tester.run() test_media_url() if 'manage.py test' in ' '.join(sys.argv): test_settings_for_test_runner() @transaction.commit_manually def run(): """runs all the startup procedures""" try: run_startup_tests() except AskbotConfigError, error: transaction.rollback() print error sys.exit(1) try: from askbot.models import badges badges.init_badges() transaction.commit() except Exception, error: print error transaction.rollback()
'message': 'Please replace setting ASKBOT_UPLOADED_FILES_URL ', 'replace_hint': "with MEDIA_URL = '/%s'" }, 'RECAPTCHA_USE_SSL': { 'value': True, 'message': 'Please add: RECAPTCHA_USE_SSL = True' } }) settings_tester.run() test_media_url() if 'manage.py test' in ' '.join(sys.argv): test_settings_for_test_runner() test_custom_user_profile_tab() @transaction.commit_manually def run(): """runs all the startup procedures""" try: run_startup_tests() except AskbotConfigError, error: transaction.rollback() print error sys.exit(1) try: from askbot.models import badges badges.init_badges() transaction.commit() except Exception, error: print error transaction.rollback()