views: set course_label template to <UE>_<year>_[Gr1_]<Sponsor>

fixes #2491
This commit is contained in:
Benjamin Dauvergne 2013-06-07 18:03:00 +02:00
parent ccec8cd9a3
commit 1b1397dd9a
1 changed files with 2 additions and 6 deletions

View File

@ -36,14 +36,10 @@ def create_course(request):
conn = django_ws.get_bb_conn()
course_id = form.cleaned_data['course_id']
entity = form.cleaned_data['entity']
diploma = entity.parents().get(
entity_type__name=settings.POLYNUM_BB_DIPLOMA_DESIGNATION)
owner_name = request.user.display_name().title()
owner_name = request.sponsor_name()
if document and '(' in document.sponsor:
owner_name = document.sponsor.split('(')[0]
course_label = diploma.get_name() + '_' + \
settings.POLYNUM_BB_COURSE_YEAR + '_' + \
entity.get_name()
course_label = entity.code.upper() + '_' + settings.POLYNUM_BB_COURSE_YEAR
if form.cleaned_data.get('td_group'):
course_label += '_Gr' + form.cleaned_data['td_group']
course_label += '_' + owner_name