def regulations_item(request, tournament_id=None, format='html'): regulations = api.regulations_get(tournament_id = tournament_id) if regulations is None and request.is_owner: return http.HttpResponseRedirect("/tournament/" + tournament_id + "/regulations/edit/") if format == 'html': return api.response_get(request, locals(), 'tournament/templates/regulations_item.html')
def regulations_edit(request, tournament_id=None, format='html'): if not request.is_owner: return http.HttpResponseRedirect("/tournament/" + tournament_id + "/") regulations = api.regulations_get(tournament_id = tournament_id) if request.POST and request.is_owner: content = request.POST.get("content", "") logging.info("content: %s",content) item = api.regulations_edit(content = content, tournament_id = tournament_id) return http.HttpResponseRedirect("/tournament/" + tournament_id + "/regulations/") area = 'regulations' if format == 'html': return api.response_get(request, locals(), 'tournament/templates/regulations_edit.html')