hide profile-related pages if "enable_users" is False
use comman instead of semicolon by default (for CSV)
This commit is contained in:
parent
e4e2e416db
commit
16b41e3dec
1 changed files with 7 additions and 1 deletions
|
@ -537,6 +537,8 @@ def user_logout(bobo_request):
|
||||||
@bobo.query('/profile/resend')
|
@bobo.query('/profile/resend')
|
||||||
def resend_user_key(bobo_request, email=None, submit=None, email_sent=None):
|
def resend_user_key(bobo_request, email=None, submit=None, email_sent=None):
|
||||||
value_dict = get_default_values(bobo_request)
|
value_dict = get_default_values(bobo_request)
|
||||||
|
if not value_dict["enable_users"]:
|
||||||
|
return bobo.redirect(BASE_DICT["base_url"])
|
||||||
value_dict["email_sent"] = False
|
value_dict["email_sent"] = False
|
||||||
value_dict["user_new"] = False
|
value_dict["user_new"] = False
|
||||||
data = {"email": email}
|
data = {"email": email}
|
||||||
|
@ -592,6 +594,8 @@ def manage_link_in_profile(user, link, add, value_dict):
|
||||||
@bobo.query('/profile/new')
|
@bobo.query('/profile/new')
|
||||||
def user_create(bobo_request, email=None, submit=None, add_link=None):
|
def user_create(bobo_request, email=None, submit=None, add_link=None):
|
||||||
value_dict = get_default_values(bobo_request)
|
value_dict = get_default_values(bobo_request)
|
||||||
|
if not value_dict["enable_users"]:
|
||||||
|
return bobo.redirect(BASE_DICT["base_url"])
|
||||||
value_dict["user_new"] = True
|
value_dict["user_new"] = True
|
||||||
data = {"email": email, "add_link": add_link}
|
data = {"email": email, "add_link": add_link}
|
||||||
if not submit:
|
if not submit:
|
||||||
|
@ -625,6 +629,8 @@ def user_create(bobo_request, email=None, submit=None, add_link=None):
|
||||||
@bobo.query('/:del_link/forget')
|
@bobo.query('/:del_link/forget')
|
||||||
def show_user(bobo_request, hash_key=None, add_link=None, del_link=None):
|
def show_user(bobo_request, hash_key=None, add_link=None, del_link=None):
|
||||||
value_dict = get_default_values(bobo_request)
|
value_dict = get_default_values(bobo_request)
|
||||||
|
if not value_dict["enable_users"]:
|
||||||
|
return bobo.redirect(BASE_DICT["base_url"])
|
||||||
if hash_key:
|
if hash_key:
|
||||||
# overwrite the cookie-based value, if a profile is explicitely given
|
# overwrite the cookie-based value, if a profile is explicitely given
|
||||||
user_hash_key = hash_key
|
user_hash_key = hash_key
|
||||||
|
@ -753,7 +759,7 @@ def export_poll(bobo_request, admin_hash_key=None):
|
||||||
poll = Poll.get(poll_id)
|
poll = Poll.get(poll_id)
|
||||||
response = webob.Response(content_type="text/csv", charset=EXPORT_CHARSET)
|
response = webob.Response(content_type="text/csv", charset=EXPORT_CHARSET)
|
||||||
# common (excel-based) CSV format with semicolons instead of commas
|
# common (excel-based) CSV format with semicolons instead of commas
|
||||||
writer = csv.writer(response.body_file, delimiter=";")
|
writer = csv.writer(response.body_file)
|
||||||
submissions = list(poll.get_submissions())
|
submissions = list(poll.get_submissions())
|
||||||
for submission in submissions:
|
for submission in submissions:
|
||||||
timestamp = submission.timestamp_creation.strftime(EXPORT_DATE_FORMAT)
|
timestamp = submission.timestamp_creation.strftime(EXPORT_DATE_FORMAT)
|
||||||
|
|
Loading…
Reference in a new issue