Merge branch 'fix-file-uploads' into 'master'
fix file uploads especially for content. See merge request engineering/make-post-sell/make_post_sell!30
This commit is contained in:
commit
689c372913
4 changed files with 7 additions and 3 deletions
|
|
@ -110,6 +110,8 @@ def includeme(config):
|
|||
# content routes.
|
||||
config.add_route("content_new", "/c/new")
|
||||
config.add_route("content", "/c/{content_id}")
|
||||
config.add_route("content_edit", "/c/{product_id}/edit")
|
||||
config.add_route("content_edit2", "/c/{product_id}/{slug:.*}/edit")
|
||||
config.add_route("content_slug", "/c/{product_id}/{slug:.*}")
|
||||
|
||||
# product routes.
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
{%- block call_to_action -%}
|
||||
{% if request.user.can_edit_shop(request.shop) %}
|
||||
<a href="/p/{{ product.id }}/edit" class="product-edit-button mps-button mps-button-small">✎ Edit</a>
|
||||
<a href="{{ product.absolute_edit_url(request) }}" class="product-edit-button mps-button mps-button-small">✎ Edit</a>
|
||||
{% endif %}
|
||||
{%- endblock call_to_action -%}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ Your cover (<code>thumbnail1</code>) will show up on search pages.
|
|||
</section>
|
||||
|
||||
<section class="product-title-and-description well2">
|
||||
<form method="post" action="/p/{{ product.id }}/edit" onsubmit="submit.disabled = true; return true;">
|
||||
<form method="post" action="{{ product.absolute_edit_url(request) }}" onsubmit="submit.disabled = true; return true;">
|
||||
<h3>Edit Title, Description, or Visibility</h3>
|
||||
|
||||
<label for="title_input">Title</label>
|
||||
|
|
|
|||
|
|
@ -193,6 +193,8 @@ def product_edit_description(request):
|
|||
|
||||
@view_config(route_name="product_edit", renderer="product_edit.j2")
|
||||
@view_config(route_name="product_edit2", renderer="product_edit.j2")
|
||||
@view_config(route_name="content_edit", renderer="product_edit.j2")
|
||||
@view_config(route_name="content_edit2", renderer="product_edit.j2")
|
||||
@shop_editor_required()
|
||||
def product_edit(request):
|
||||
product_modified = False
|
||||
|
|
@ -312,7 +314,7 @@ def product_edit(request):
|
|||
|
||||
# redirect back to this page to clear
|
||||
# the params posted by the s3 webhooks.
|
||||
return HTTPFound(f"/p/{product.id}/{product.slug}/edit?uploaded={file_key}")
|
||||
return HTTPFound(f"{product.absolute_edit_url(request)}?uploaded={file_key}")
|
||||
|
||||
if product_modified and product.error_message is None:
|
||||
request.dbsession.add(product)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue