Commit 976d464e26fee685c5a3318d5f2b033158a022ea

Authored by fbormann
1 parent 753af621

uploaded file notification working

Showing 1 changed file with 2 additions and 1 deletions   Show diff stats
files/views.py
@@ -12,6 +12,7 @@ from .utils import mime_type_to_material_icons @@ -12,6 +12,7 @@ from .utils import mime_type_to_material_icons
12 from courses.models import Topic 12 from courses.models import Topic
13 from core.models import MimeType 13 from core.models import MimeType
14 from core.mixins import NotificationMixin 14 from core.mixins import NotificationMixin
  15 +from django.urls import reverse
15 16
16 # Create your views here. 17 # Create your views here.
17 class CreateFile(LoginRequiredMixin, HasRoleMixin, NotificationMixin, generic.edit.CreateView): 18 class CreateFile(LoginRequiredMixin, HasRoleMixin, NotificationMixin, generic.edit.CreateView):
@@ -61,7 +62,7 @@ class CreateFile(LoginRequiredMixin, HasRoleMixin, NotificationMixin, generic.ed @@ -61,7 +62,7 @@ class CreateFile(LoginRequiredMixin, HasRoleMixin, NotificationMixin, generic.ed
61 self.object.save() 62 self.object.save()
62 #CREATE NOTIFICATION 63 #CREATE NOTIFICATION
63 super(CreateFile, self).createNotification(message="uploaded a File "+ self.object.name, actor=self.request.user, 64 super(CreateFile, self).createNotification(message="uploaded a File "+ self.object.name, actor=self.request.user,
64 - resource_name=self.object.name, resource_link= reverse('course:file:create_file', args=[self.object.slug]), 65 + resource_name=self.object.name, resource_link= reverse('course:view_topic', args=[self.object.topic.slug]),
65 users=self.object.topic.subject.students.all()) 66 users=self.object.topic.subject.students.all())
66 67
67 return self.get_success_url() 68 return self.get_success_url()