Stripped personal data from development repository
Samo Penic
2019-02-20 83c3f647c35477564b77cbc5b36d37d793d5442a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
3
#û[
ã@sÀddlmZmZddlmZddlmZddlmZddl    m
Z
ddl m Z ddl mZddlmZd    d
lmZdd lmZeed d Gdd„dee jƒƒZdd„Zedd„ƒZedd„ƒZdS)é)ÚrenderÚget_object_or_404)Ústaff_member_required)Úmethod_decorator)ÚLoginRequiredMixin)ÚUser)Úgeneric)Úreverse)ÚHttpResponseRedirecté)ÚStudentUploadForm)Úlogin_requiredÚdispatch)Únamec@seZdZeZdZdd„ZdS)ÚStudentListViewzorganization/studentlist.htmlcCs
tjjƒS)N)rÚobjectsÚall)Úself©rúC/home/samo/programiranje/django/sizif-web/aoi/organization/views.pyÚ get_querysetszStudentListView.get_querysetN)Ú__name__Ú
__module__Ú __qualname__rÚmodelÚ template_namerrrrrrsrcCs˜d}x |jƒD]}|tj|dƒ}qWxl|jdƒD]^}|jƒjdƒ}t|ƒdkrRq2y.tjj|d|d|d|d    |d
d }Wq2w2Yq2Xq2WdS) NÚÚutf8Ú
ú,éér réé)ÚusernameÚ
first_nameÚ    last_nameÚemailÚpassword)    ÚchunksÚbytesÚdecodeÚsplitÚstripÚlenrrÚ create_user)ÚfÚcontÚchunkÚlineÚfieldsÚurrrÚhandle_uploaded_files . r6cCsd|jdkrJt|j|jƒ}|jƒr>x|jjdƒD] }t|ƒq.WttdƒƒStƒ}d|i}t    |d|ƒS)NÚPOSTZ
file_fieldZ studentlistÚformzorganization/studentupload.html)
Úmethodr r7ÚFILESÚis_validÚgetlistr6r
r    r)Úrequestr8r0ÚcontextrrrÚstudentupload_view,s
  r?cCs$|jjrttdƒƒSttdƒƒSdS)z9Simple redirector to figure out where the user goes next.ZexamlistÚ studentpagesN)ÚuserÚis_staffr
r    )r=rrrÚloginlandingpage>s rCN)Údjango.shortcutsrrZ%django.contrib.admin.views.decoratorsrÚdjango.utils.decoratorsrZdjango.contrib.auth.mixinsrÚdjango.contrib.auth.modelsrZ django.viewsrÚ django.urlsr    Ú django.httpr
Úformsr Údjango.contrib.auth.decoratorsr ÚListViewrr6r?rCrrrrÚ<module>s