Commit 2fa7d5a84a5c6681fa459b68c3762408ea9bddcd
1 parent
c42f7077
Exists in
master
and in
3 other branches
message is now translated and working and showing correctly
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
subjects/static/subjects/js/modal_subject.js
... | ... | @@ -56,7 +56,7 @@ var SubscribeSubject = { |
56 | 56 | $('body').removeClass('modal-open'); |
57 | 57 | $("#modal_course").empty(); |
58 | 58 | $(".modal-backdrop.in").remove(); |
59 | - alertify.success("Subscription was succesfull!"); | |
59 | + window.location.href = data['url']; | |
60 | 60 | }).fail(function(){ |
61 | 61 | $("#modal_course").empty(); |
62 | 62 | $("#modal_course").append(data); | ... | ... |
subjects/views.py
... | ... | @@ -278,11 +278,11 @@ class SubjectSubscribeView(LoginRequiredMixin, TemplateView): |
278 | 278 | |
279 | 279 | def post(self, request, *args, **kwargs): |
280 | 280 | subject = get_object_or_404(Subject, slug= kwargs.get('slug')) |
281 | - print(subject) | |
282 | 281 | subject.students.add(request.user) |
283 | 282 | subject.save() |
284 | 283 | |
284 | + messages.success(self.request, _('Subscription was successfull!')) | |
285 | 285 | |
286 | - return HttpResponse('success') | |
286 | + return JsonResponse({'url':reverse_lazy('subjects:index')}) | |
287 | 287 | |
288 | 288 | ... | ... |