renaming function

This commit is contained in:
lars 2012-06-08 13:01:26 +00:00
parent 24598be805
commit 08727955e9

View file

@ -246,6 +246,11 @@ class Poll(sqlobject.SQLObject):
def get_submit_url(self, absolute=False):
return get_url_string("%s%s/submit" % (BASE_DICT["base_url"], self.hash_key), absolute)
#TODO vote: Diese Funktion ist noch falsch, aber erstmal als Platzhalter noetig
def get_vote_url(self, absolute=False):
return get_url_string("%s%s/submit" % (BASE_DICT["base_url"], self.hash_key), absolute)
def get_admin_url(self, absolute=False, suffix=""):
return get_url_string("%s%s%s" % (BASE_DICT["base_url"], self.admin_hash_key, suffix), absolute)
@ -783,12 +788,13 @@ def delete_poll(bobo_request, admin_hash_key=None):
return bobo.redirect(BASE_DICT["base_url"])
@bobo.query('/:admin_hash_key/vote_toggle')
def vote_toggle_poll(bobo_request, admin_hash_key=None, vote_radio=None):
# vote_radio: open/closed
def vote_toggle_poll(bobo_request, admin_hash_key=None, vote_select=None):
## vote_radio: open/closed
# vote_select: open/closed
admin_poll_id = get_poll_admin_id(admin_hash_key)
if not admin_poll_id is None:
poll = Poll.get(admin_poll_id)
poll.change_setting("vote_open", vote_radio == "open")
poll.change_setting("vote_open", vote_select == "open")
return bobo.redirect(poll.get_admin_url())
else:
return bobo.redirect(BASE_DICT["base_url"])