Commit 51e663b8daee86d116505066659cad5a0fd1bf0a
1 parent
463b702f
Exists in
master
and in
5 other branches
Updating views [Issues: #120,121,122]
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
links/views.py
... | ... | @@ -10,7 +10,7 @@ from .forms import * |
10 | 10 | |
11 | 11 | # Create your views here. |
12 | 12 | class CreateLink(generic.CreateView): |
13 | - template_name = 'links/link_modal.html' | |
13 | + template_name = 'links/create_link.html' | |
14 | 14 | form_class = CreateLinkForm |
15 | 15 | success_url = reverse_lazy('course:manage') |
16 | 16 | context_object_name = 'links' |
... | ... | @@ -22,16 +22,18 @@ class CreateLink(generic.CreateView): |
22 | 22 | def get_context_data(self, **kwargs): |
23 | 23 | context = {} |
24 | 24 | context['links'] = Link.objects.all() |
25 | + | |
25 | 26 | return context |
26 | 27 | |
27 | 28 | |
28 | 29 | def deleteLink(request,linkname): |
29 | 30 | link = get_object_or_404(Link,name = linkname) |
30 | 31 | link.delete() |
32 | + template_name = 'links/delete_link.html' | |
31 | 33 | messages.success(request,_("Link deleted Successfully!")) |
32 | 34 | return redirect('course:manage') |
33 | 35 | class UpdateLink(generic.UpdateView): |
34 | - template_name = 'links/' | |
36 | + template_name = 'links/update_link.html' | |
35 | 37 | form_class = UpdateLinkForm |
36 | 38 | success_url = reverse_lazy() |
37 | 39 | def form_valid(self, form): | ... | ... |