mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-19 05:25:42 +00:00
Fixed bugs in Inventree/views.py
- Need to pass request.FILES to the form! (duh!) - Prevent form data from being saved twice
This commit is contained in:
@ -92,7 +92,7 @@
|
||||
launchModalForm("#modal-form",
|
||||
"{% url 'part-edit' part.id %}",
|
||||
{
|
||||
reload: true
|
||||
reload: true,
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -89,6 +89,9 @@
|
||||
$("#part-thumb").click(function() {
|
||||
launchModalForm("#modal-form",
|
||||
"{% url 'part-image' part.id %}",
|
||||
{
|
||||
reload: true
|
||||
}
|
||||
);
|
||||
});
|
||||
{% endblock %}
|
@ -96,6 +96,11 @@ class PartImage(AjaxUpdateView):
|
||||
ajax_form_title = 'Upload Part Image'
|
||||
form_class = PartImageForm
|
||||
|
||||
def get_data(self):
|
||||
return {
|
||||
'success': 'Updated part image',
|
||||
}
|
||||
|
||||
|
||||
class PartEdit(AjaxUpdateView):
|
||||
model = Part
|
||||
|
Reference in New Issue
Block a user