Fix some context values for can_modify in context
can_modify needs to be present in order to load the modify.js script. This wasn't present on the PostView and was on a couple of unnecessary views. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -144,7 +144,6 @@ class PostCreateView(CreateView):
|
|||||||
context["capcodes"] = get_objects_for_user(
|
context["capcodes"] = get_objects_for_user(
|
||||||
get_user(self.request), "board.use_capcode"
|
get_user(self.request), "board.use_capcode"
|
||||||
)
|
)
|
||||||
kwargs["can_modify"] = can_modify(self.request.user)
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
@@ -208,7 +207,6 @@ class ReplyCreateView(CreateView):
|
|||||||
context["capcodes"] = get_objects_for_user(
|
context["capcodes"] = get_objects_for_user(
|
||||||
get_user(self.request), "board.use_capcode"
|
get_user(self.request), "board.use_capcode"
|
||||||
)
|
)
|
||||||
kwargs["can_modify"] = can_modify(self.request.user)
|
|
||||||
return context
|
return context
|
||||||
|
|
||||||
def get_form_kwargs(self):
|
def get_form_kwargs(self):
|
||||||
@@ -237,6 +235,7 @@ class PostView(TemplateView):
|
|||||||
post_id = self.kwargs["id"]
|
post_id = self.kwargs["id"]
|
||||||
kwargs["post"] = get_object_or_404(Post, id=post_id)
|
kwargs["post"] = get_object_or_404(Post, id=post_id)
|
||||||
kwargs["max_upload_size"] = settings.MAX_UPLOAD_SIZE
|
kwargs["max_upload_size"] = settings.MAX_UPLOAD_SIZE
|
||||||
|
kwargs["can_modify"] = can_modify(self.request.user)
|
||||||
|
|
||||||
return super(PostView, self).get_context_data(**kwargs)
|
return super(PostView, self).get_context_data(**kwargs)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user