Rename group AJAX URL parameter to acronym instead of groupname since

it is in fact the acronym, not the name of the group
 - Legacy-Id: 7064
This commit is contained in:
Ole Laursen 2013-12-24 12:49:25 +00:00
parent c098fb4f07
commit 083b3138c6
2 changed files with 3 additions and 8 deletions

View file

@ -1,20 +1,15 @@
import datetime
import logging
import sys
import json
from django.shortcuts import get_object_or_404
from django.http import HttpResponse, Http404
from dajaxice.core import dajaxice_functions
from dajaxice.decorators import dajaxice_register
from ietf.group.models import Group
def group_json(request, groupname):
group = get_object_or_404(Group, acronym=groupname)
def group_json(request, acronym):
group = get_object_or_404(Group, acronym=acronym)
#print "group request is: %s\n" % (request.build_absolute_uri('/'))
return HttpResponse(json.dumps(group.json_dict(request.build_absolute_uri('/')),
sort_keys=True, indent=2),
content_type="text/json")

View file

@ -3,7 +3,7 @@
from django.conf.urls import patterns, url
urlpatterns = patterns('',
(r'^(?P<groupname>[a-z0-9]+).json$', 'ietf.group.ajax.group_json'),
(r'^(?P<acronym>[a-z0-9]+).json$', 'ietf.group.ajax.group_json'),
)