Commit 3646ec61c32049d050f457e9a02c56368e2f73eb

Authored by Gustavo
1 parent 2b193a58

Included news objects in the carroussel view

Showing 1 changed file with 4 additions and 2 deletions   Show diff stats
subjects/views.py
... ... @@ -32,6 +32,7 @@ from .forms import CreateSubjectForm, UpdateSubjectForm
32 32 from .utils import has_student_profile, has_professor_profile, count_subjects, get_category_page
33 33 from users.models import User
34 34 from topics.models import Topic, Resource
  35 +from news.models import News
35 36  
36 37 from amadeus.permissions import has_category_permissions, has_subject_permissions, has_subject_view_permissions, has_resource_permissions
37 38  
... ... @@ -59,6 +60,7 @@ class HomeView(LoginRequiredMixin, ListView):
59 60 context = super(HomeView, self).get_context_data(**kwargs)
60 61 context['title'] = _('Home')
61 62 context['show_buttons'] = True #So it shows subscribe and access buttons
  63 + context['news'] = News.objects.all()
62 64  
63 65 #bringing users
64 66 tag_amount = 50
... ... @@ -521,8 +523,8 @@ class SubjectDetailView(LoginRequiredMixin, LogMixin, DetailView):
521 523 expire_time = settings.SESSION_SECURITY_EXPIRE_AFTER
522 524  
523 525 context['participants'] = User.objects.filter(
524   - Q(is_staff = True) | Q(subject_student__slug = sub) |
525   - Q(professors__slug = sub) |
  526 + Q(is_staff = True) | Q(subject_student__slug = sub) |
  527 + Q(professors__slug = sub) |
526 528 Q(coordinators__subject_category__slug = sub)
527 529 ).extra(select = {'status': status_query}, select_params=(expire_time, expire_time,),).distinct().order_by('status', 'social_name','username').exclude(email = self.request.user.email)
528 530  
... ...