ó
#Ü[c           @   s  d  d l  m Z m Z d  d l m Z m Z m Z d  d l m Z d  d l	 m
 Z
 d  d l m Z d  d l m Z d  d l Td  d l Td  d l Td  d l Td  d l m Z e d	 „  ƒ Z e d
 „  ƒ Z e d „  ƒ Z e d „  ƒ Z e d ƒ d „  ƒ Z e d „  ƒ Z d S(   iÿÿÿÿ(   t   rendert   get_object_or_404(   t   HttpResponseRedirectt   Http404t   HttpResponse(   t   reverse(   t   messages(   t   slugify(   t   permission_required(   t   *(   t
   serve_filec         C   sJ   t  t d |  j ƒ} t j j d | ƒ j d ƒ } t |  d i | d 6ƒ S(   Nt   usert   members   -start_times*   members/exam_application/applications.htmlt   applications(   R   t   MemberR   t   ExamApplicationt   objectst   filtert   order_byR    (   t   requestR   R   (    (    sC   /var/www/svtgbi.org/svtgbi/modules/exam_application/accountviews.pyR      s    c         C   sD   t  t d |  j ƒ} t  t d | d | ƒ} t |  d i | d 6ƒ S(   NR   R   t   ids.   members/exam_application/view-application.htmlt   application(   R   R   R   R   R    (   R   t   application_idR   t   exam_application(    (    sC   /var/www/svtgbi.org/svtgbi/modules/exam_application/accountviews.pyt   view_application   s    c         C   sC   t  t d |  j ƒ} t  t d | d | ƒ} t |  | j d t ƒS(   NR   R   R   t   save_as(   R   R   R   R   R
   t   degree_certificatet   True(   R   R   R   R   (    (    sC   /var/www/svtgbi.org/svtgbi/modules/exam_application/accountviews.pyt   download_degree_certificate#   s    c         C   sC   t  t d |  j ƒ} t  t d | d | ƒ} t |  | j d t ƒS(   NR   R   R   R   (   R   R   R   R   R
   t   exam_results_letterR   (   R   R   R   R   (    (    sC   /var/www/svtgbi.org/svtgbi/modules/exam_application/accountviews.pyt   download_results_letter+   s    s(   admin_users.can_access_exam_applicationsc         C   sC   t  t d |  j ƒ} t  t d | d | ƒ} t |  t j d t ƒS(   NR   R   R   R   (   R   R   R   R   R
   R   t   reference_uploadR   (   R   t   exam_idR   R   R   (    (    sC   /var/www/svtgbi.org/svtgbi/modules/exam_application/accountviews.pyt   download_references3   s    c         C   sC   t  t d |  j ƒ} t  t d | d | ƒ} t |  | j d t ƒS(   NR   R   R   R   (   R   R   R   R   R
   t   non_degree_evidenceR   (   R   R   R   R   (    (    sC   /var/www/svtgbi.org/svtgbi/modules/exam_application/accountviews.pyt   download_non_degree_evidence;   s    N(   t   django.shortcutsR    R   t   django.httpR   R   R   t   django.core.urlresolversR   t   django.contribR   t   django.template.defaultfiltersR   t   django.contrib.auth.decoratorsR   t   modules.core.functionst   modules.core.decoratorst   formst   modelst   filetransfers.apiR
   t   members_onlyR   R   R   R   R!   R#   (    (    (    sC   /var/www/svtgbi.org/svtgbi/modules/exam_application/accountviews.pyt   <module>   s    



