Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Greeting for anonymous users can be disabled from live settings

  • Loading branch information...
commit f0a889b97eba513f576ad61c850ce08b3d580859 1 parent b208c56
@raags authored
Showing with 11 additions and 1 deletion.
  1. +9 −0 askbot/conf/site_settings.py
  2. +2 −1  askbot/middleware/anon_user.py
View
9 askbot/conf/site_settings.py
@@ -70,6 +70,15 @@
)
settings.register(
+ livesettings.BooleanValue(
+ QA_SITE_SETTINGS,
+ 'GREETING_FOR_ANON_USER_ON',
+ default = True,
+ description = _('Check to enable greeting for anonymous user')
+ )
+)
+
+settings.register(
livesettings.StringValue(
QA_SITE_SETTINGS,
'GREETING_FOR_ANONYMOUS_USER',
View
3  askbot/middleware/anon_user.py
@@ -43,7 +43,8 @@ def process_request(self, request):
#also set the first greeting one time per session only
if 'greeting_set' not in request.session and \
- 'askbot_visitor' not in request.COOKIES:
+ 'askbot_visitor' not in request.COOKIES and \
+ askbot_settings.GREETING_FOR_ANON_USER_ON:
request.session['greeting_set'] = True
msg = askbot_settings.GREETING_FOR_ANONYMOUS_USER
request.user.message_set.create(message=msg)
Please sign in to comment.
Something went wrong with that request. Please try again.