Commit 866bf3fcef92c3dadde7f3ce14af5874d48014ae
1 parent
f7410615
Exists in
master
and in
5 other branches
Removed useless code in IndexCatView [Issue:#398]
Showing
1 changed file
with
0 additions
and
19 deletions
Show diff stats
courses/views.py
| ... | ... | @@ -450,25 +450,6 @@ class IndexCatView(LoginRequiredMixin, generic.ListView): |
| 450 | 450 | context_object_name = 'categories' |
| 451 | 451 | paginate_by = 5 |
| 452 | 452 | |
| 453 | - ''' | |
| 454 | - def get_context_data(self, **kwargs): | |
| 455 | - context = super(IndexCatView, self).get_context_data(**kwargs) | |
| 456 | - list_cat = CourseCategory.objects.filter(course_category = True).order_by('name') | |
| 457 | - paginator = Paginator(list_cat, self.paginate_by) | |
| 458 | - page = self.request.GET.get('page') | |
| 459 | - | |
| 460 | - print(list_cat) | |
| 461 | - try: | |
| 462 | - list_cat = paginator.page(page) | |
| 463 | - except PageNotAnInteger: | |
| 464 | - list_cat = paginator.page(1) | |
| 465 | - except EmptyPage: | |
| 466 | - list_cat = paginator.page(paginator.num_pages) | |
| 467 | - | |
| 468 | - context['list_cat'] = list_cat | |
| 469 | - | |
| 470 | - return context | |
| 471 | - ''' | |
| 472 | 453 | class CreateCatView(LoginRequiredMixin, HasRoleMixin, generic.edit.CreateView): |
| 473 | 454 | |
| 474 | 455 | allowed_roles = ['professor', 'system_admin'] | ... | ... |