Commit 858671e684ede1ce04e749adb9f91454281bcee9
1 parent
bfdd320f
Exists in
master
and in
5 other branches
fixed teacher create subject button on courses:view
Showing
3 changed files
with
8 additions
and
4 deletions
Show diff stats
app/views.py
| ... | ... | @@ -40,7 +40,7 @@ class AppIndex(LoginRequiredMixin, LogMixin, ListView, NotificationMixin): |
| 40 | 40 | else: |
| 41 | 41 | self.template_name = "home_teacher_student_content.html" |
| 42 | 42 | |
| 43 | - super(AppIndex, self).createNotification("testando notificacao de login", resource_name="home", resource_link="/") | |
| 43 | + super(AppIndex, self).createNotification("you have just logged in", resource_name="home", resource_link="/") | |
| 44 | 44 | return self.response_class(request = self.request, template = self.template_name, context = context, using = self.template_engine, **response_kwargs) |
| 45 | 45 | |
| 46 | 46 | ... | ... |
courses/templates/course/view.html
| ... | ... | @@ -301,7 +301,7 @@ |
| 301 | 301 | {% endfor %} |
| 302 | 302 | {% endif %} |
| 303 | 303 | |
| 304 | -{% if user|has_role:'professor' and user in course.professors or user|has_role:'system_admin' %} | |
| 304 | +{% if user|has_role:'professor' and user in course.professors.all or user|has_role:'system_admin' %} | |
| 305 | 305 | |
| 306 | 306 | <div class="form-group"> |
| 307 | 307 | <a href="{% url 'course:create_subject' course.slug %}" data-toggle="modal" data-target="" class="btn btn-primary btn-lg btn-block btn-raised">{% trans 'Create Subject' %}<div class="ripple-container"></div></a> | ... | ... |
forum/views.py
| ... | ... | @@ -9,6 +9,7 @@ from django.http import Http404 |
| 9 | 9 | |
| 10 | 10 | from .models import Forum, Post, PostAnswer |
| 11 | 11 | from courses.models import Topic |
| 12 | +from core.mixins import NotificationMixin | |
| 12 | 13 | |
| 13 | 14 | from .forms import ForumForm, PostForm, PostAnswerForm |
| 14 | 15 | |
| ... | ... | @@ -36,7 +37,7 @@ class ForumIndex(LoginRequiredMixin, generic.ListView): |
| 36 | 37 | |
| 37 | 38 | return context |
| 38 | 39 | |
| 39 | -class CreateForumView(LoginRequiredMixin, generic.edit.CreateView): | |
| 40 | +class CreateForumView(LoginRequiredMixin, generic.edit.CreateView, NotificationMixin): | |
| 40 | 41 | login_url = reverse_lazy("core:home") |
| 41 | 42 | redirect_field_name = 'next' |
| 42 | 43 | |
| ... | ... | @@ -51,7 +52,10 @@ class CreateForumView(LoginRequiredMixin, generic.edit.CreateView): |
| 51 | 52 | |
| 52 | 53 | def get_success_url(self): |
| 53 | 54 | self.success_url = reverse('course:forum:render_forum', args = (self.object.id, )) |
| 54 | - | |
| 55 | + print(self.object) | |
| 56 | + print(self) | |
| 57 | + #super(CreateForumView, self).createNotification(message="The Forum",action_name="create forum", ) | |
| 58 | + | |
| 55 | 59 | return self.success_url |
| 56 | 60 | |
| 57 | 61 | def render_forum(request, forum): | ... | ... |