Added made group a json object in the json_agenda, and added session.group.type information.
- Legacy-Id: 12005
This commit is contained in:
parent
f01327cba7
commit
e917c5a0df
|
@ -38,10 +38,12 @@ from django.conf import settings
|
|||
from django.core.cache import cache
|
||||
from django.core.urlresolvers import reverse as urlreverse
|
||||
from django.db.models import Q
|
||||
from django.db.models.query import EmptyQuerySet
|
||||
from django.http import Http404, HttpResponseBadRequest, HttpResponse, HttpResponseRedirect, QueryDict
|
||||
from django.shortcuts import render
|
||||
from django.utils.cache import _generate_cache_key
|
||||
|
||||
|
||||
import debug # pyflakes:ignore
|
||||
|
||||
from ietf.doc.models import ( Document, DocHistory, DocAlias, State,
|
||||
|
@ -142,7 +144,7 @@ def retrieve_search_results(form, all_types=False):
|
|||
types.extend(query["doctypes"])
|
||||
|
||||
if not types:
|
||||
return []
|
||||
return EmptyQuerySet()
|
||||
|
||||
docs = Document.objects.filter(type__in=types)
|
||||
|
||||
|
|
|
@ -906,9 +906,14 @@ def json_agenda(request, num=None ):
|
|||
sessdict = dict()
|
||||
sessdict['objtype'] = 'session'
|
||||
sessdict['id'] = asgn.pk
|
||||
if asgn.session.group.type_id in ['wg','rg']:
|
||||
sessdict['group'] = asgn.session.group.acronym
|
||||
sessdict['parent'] = asgn.session.group.parent.acronym
|
||||
if asgn.session.group:
|
||||
sessdict['group'] = {
|
||||
"acronym": asgn.session.group.acronym,
|
||||
"name": asgn.session.group.name,
|
||||
"type": asgn.session.group.type_id,
|
||||
}
|
||||
if asgn.session.group.type_id in ['wg','rg', 'ag',] or asgn.session.group.acronym in ['iesg',]:
|
||||
sessdict['group']['parent'] = asgn.session.group.parent.acronym
|
||||
parent_acronyms.add(asgn.session.group.parent.acronym)
|
||||
if asgn.session.name:
|
||||
sessdict['name'] = asgn.session.name
|
||||
|
|
Loading…
Reference in a new issue