Skip to content

Commit

Permalink
(Small) Fixes to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel2392 committed Apr 5, 2024
1 parent 0be495c commit 09eeb7c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = wagtail_fedit
version = 1.3.7
version = 1.3.8
description = An application made for the Django Web Framework.
long_description = file: README.md
long_description_content_type = text/markdown
Expand Down
3 changes: 1 addition & 2 deletions wagtail_fedit/templatetags/fedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def render_editable_field(request, content, field_name, model, context, **kwargs

kwargs["wagtail_fedit_field_name"] = field_name
kwargs["wagtail_fedit_instance"] = model

kwargs["inline"] = str(kwargs.get("inline", False)).lower() == "true"
return render_to_string(
"wagtail_fedit/content/editable_field.html",
{
Expand All @@ -371,7 +371,6 @@ def render_editable_field(request, content, field_name, model, context, **kwargs
"content": content,
"parent_context": context,
"toolbar_items": items,
"inline": str(kwargs.get("inline", False)).lower() == "true",
**kwargs,
},
request=request,
Expand Down
10 changes: 6 additions & 4 deletions wagtail_fedit/views/editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
USERBAR_MODEL_VAR,
FeditPermissionCheck,
with_userbar_model,
user_can_publish,
user_can_unpublish,
user_can_submit_for_moderation,
lock_info,
# user_can_publish,
# user_can_unpublish,
# user_can_submit_for_moderation,
# lock_info,
)

from .mixins import (
Expand All @@ -61,6 +61,8 @@ def get_publish_action(object):

class BaseFeditView(ObjectViewMixin, FeditPermissionCheck, TemplateView):
def dispatch(self, request: HttpRequest, object_id: Any, app_label: str, model_name: str) -> HttpResponse:
if self.error_response:
return self.error_response

if not self.has_perms(request, self.object):
return HttpResponseForbidden("You do not have permission to view this page")
Expand Down
1 change: 1 addition & 0 deletions wagtail_fedit/views/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def setup(self, request: HttpRequest, object_id: Any, app_label: str, model_name
except (self.model.DoesNotExist):
self.error_response = HttpResponseBadRequest("Model not found")


def dispatch(self, request: HttpRequest, object_id: Any, app_label: str, model_name: str) -> HttpResponse:
if self.error_response:
return self.error_response
Expand Down

0 comments on commit 09eeb7c

Please sign in to comment.