Commit 3638ec183362dda1756861957e60a1dd11683744
1 parent
c35730d0
Exists in
master
and in
3 other branches
Adding log to replicate category
Showing
1 changed file
with
8 additions
and
0 deletions
Show diff stats
categories/views.py
@@ -74,6 +74,7 @@ class CreateCategory(views.SuperuserRequiredMixin, HasRoleMixin, LogMixin, Creat | @@ -74,6 +74,7 @@ class CreateCategory(views.SuperuserRequiredMixin, HasRoleMixin, LogMixin, Creat | ||
74 | 74 | ||
75 | def get_initial(self): | 75 | def get_initial(self): |
76 | initial = super(CreateCategory, self).get_initial() | 76 | initial = super(CreateCategory, self).get_initial() |
77 | + | ||
77 | if self.kwargs.get('slug'): | 78 | if self.kwargs.get('slug'): |
78 | category = get_object_or_404(Category, slug = self.kwargs['slug']) | 79 | category = get_object_or_404(Category, slug = self.kwargs['slug']) |
79 | initial = initial.copy() | 80 | initial = initial.copy() |
@@ -82,6 +83,13 @@ class CreateCategory(views.SuperuserRequiredMixin, HasRoleMixin, LogMixin, Creat | @@ -82,6 +83,13 @@ class CreateCategory(views.SuperuserRequiredMixin, HasRoleMixin, LogMixin, Creat | ||
82 | initial['name'] = category.name | 83 | initial['name'] = category.name |
83 | initial['visible'] = category.visible | 84 | initial['visible'] = category.visible |
84 | #initial['coordinators'] = category.coordinators | 85 | #initial['coordinators'] = category.coordinators |
86 | + | ||
87 | + self.log_action = 'replicate' | ||
88 | + | ||
89 | + self.log_context['replicated_category_id'] = category.id | ||
90 | + self.log_context['replicated_category_name'] = category.name | ||
91 | + self.log_context['replicated_category_slug'] = category.slug | ||
92 | + | ||
85 | return initial | 93 | return initial |
86 | 94 | ||
87 | 95 |