Commit 899f93571001243524598fab3834913e51437b10

Authored by Matheus Lins
1 parent 4601482f

fixing some bugs in professor's course

courses/templates/course/view.html
... ... @@ -17,7 +17,7 @@
17 17 {% block sidebar %}
18 18 <div class="panel panel-primary">
19 19 <div class="panel-heading">
20   - <img src="{{ user.image.url }}" id="img" class="img-circle img-responsive">
  20 + <img src="{{ user.image_url }}" id="img" class="img-circle img-responsive">
21 21 </br>
22 22 <div class="row">
23 23 <div class="col-xs-3 col-md-3">
... ...
courses/views.py
... ... @@ -31,7 +31,7 @@ class IndexView(LoginRequiredMixin, NotificationMixin, generic.ListView):
31 31 def get_context_data(self, **kwargs):
32 32 context = super(IndexView, self).get_context_data(**kwargs)
33 33 context['categories'] = Category.objects.all()
34   - super.createNotification(users= User.obejcts.all(), message="testando a notificacao em login")
  34 + # super.createNotification(users= User.obejcts.all(), message="testando a notificacao em login")
35 35 return context
36 36  
37 37 class CreateCourseView(LoginRequiredMixin, HasRoleMixin, NotificationMixin,generic.edit.CreateView):
... ... @@ -140,6 +140,8 @@ class CourseView(LoginRequiredMixin, NotificationMixin, generic.DetailView):
140 140 template_name = 'course/view.html'
141 141  
142 142 def get_context_data(self, **kwargs):
  143 + subjects = None
  144 + courses = None
143 145 context = super(CourseView, self).get_context_data(**kwargs)
144 146 course = get_object_or_404(Course, slug = self.kwargs.get('slug'))
145 147 if has_role(self.request.user,'system_admin'):
... ...