Commit cc3fcb1b8bcbc2a11066c1ac51bb78ecbfc229e2
1 parent
fe73d6be
Exists in
master
and in
5 other branches
Changing context name to apply fields [Issue: #120]
Showing
1 changed file
with
1 additions
and
2 deletions
Show diff stats
links/views.py
| @@ -13,7 +13,7 @@ class CreateLink(generic.CreateView): | @@ -13,7 +13,7 @@ class CreateLink(generic.CreateView): | ||
| 13 | template_name = 'links/create_link.html' | 13 | template_name = 'links/create_link.html' |
| 14 | form_class = CreateLinkForm | 14 | form_class = CreateLinkForm |
| 15 | success_url = reverse_lazy('course:manage') | 15 | success_url = reverse_lazy('course:manage') |
| 16 | - context_object_name = 'links' | 16 | + context_object_name = 'form' |
| 17 | 17 | ||
| 18 | def form_valid(self, form): | 18 | def form_valid(self, form): |
| 19 | form.save() | 19 | form.save() |
| @@ -26,7 +26,6 @@ class CreateLink(generic.CreateView): | @@ -26,7 +26,6 @@ class CreateLink(generic.CreateView): | ||
| 26 | context['form'] = CreateLinkForm | 26 | context['form'] = CreateLinkForm |
| 27 | return context | 27 | return context |
| 28 | 28 | ||
| 29 | - | ||
| 30 | def deleteLink(request,linkname): | 29 | def deleteLink(request,linkname): |
| 31 | link = get_object_or_404(Link,name = linkname) | 30 | link = get_object_or_404(Link,name = linkname) |
| 32 | link.delete() | 31 | link.delete() |