This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Email/gmail configuration | |
| # console.EmailBackend is to test the email on console in dev mode | |
| # comment next line to spit emails on console for testing (of course comment the line next to it) | |
| # EMAIL_BACKEND='django.core.mail.backends.console.EmailBackend' | |
| # smtp.EmailBackend is for the production server | |
| EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend' | |
| EMAIL_HOST='smtp.gmail.com' | |
| EMAIL_PORT=587 | |
| EMAIL_HOST_USER='[email protected]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def delete_practice(request): | |
| if request.is_ajax and request.POST: | |
| kb_practice_id = request.POST.get('kb_practice_id') | |
| Practice.objects.get(id=kb_practice_id).delete() | |
| return HttpResponse(json.dumps({}), content_type="application/json") | |
| else: | |
| raise Http404 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def add_new_practice(request): | |
| if request.is_ajax and request.POST: | |
| protocol_id = request.POST.get('protocol_id') | |
| form = PracticeModelForm(request.POST) | |
| if form.is_valid(): | |
| practice_object = Practice(protocol=Protocol.objects.get(id=protocol_id)) | |
| form = PracticeModelForm(request.POST, instance=practice_object) | |
| form.save() | |
| return HttpResponse(json.dumps({})) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TH><span class="add-new-practice">Add New Practice</span></TH> |
NewerOlder