mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fixed part image upload
- Image was being saved twice - Don't call super().post in AjaxUpdateView - Instead, handle properly
This commit is contained in:
parent
ac17cf0121
commit
4aef7643a0
@ -202,9 +202,7 @@ class AjaxUpdateView(AjaxMixin, UpdateView):
|
||||
|
||||
super(UpdateView, self).get(request, *args, **kwargs)
|
||||
|
||||
form = self.get_form()
|
||||
|
||||
return self.renderJsonResponse(request, form, context=self.get_context_data())
|
||||
return self.renderJsonResponse(request, self.get_form(), context=self.get_context_data())
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
""" Respond to POST request.
|
||||
@ -215,7 +213,8 @@ class AjaxUpdateView(AjaxMixin, UpdateView):
|
||||
- Otherwise, return sucess status
|
||||
"""
|
||||
|
||||
super(UpdateView, self).post(request, *args, **kwargs)
|
||||
# Make sure we have an object to point to
|
||||
self.object = self.get_object()
|
||||
|
||||
form = self.get_form()
|
||||
|
||||
|
@ -115,10 +115,10 @@ class Part(models.Model):
|
||||
return reverse('part-detail', kwargs={'pk': self.id})
|
||||
|
||||
# Short name of the part
|
||||
name = models.CharField(max_length=100, unique=True, help_text='Part name (must be unique)')
|
||||
name = models.CharField(max_length=100, unique=True, blank=False, help_text='Part name (must be unique)')
|
||||
|
||||
# Longer description of the part (optional)
|
||||
description = models.CharField(max_length=250, help_text='Part description')
|
||||
description = models.CharField(max_length=250, blank=False, help_text='Part description')
|
||||
|
||||
# Internal Part Number (optional)
|
||||
# Potentially multiple parts map to the same internal IPN (variants?)
|
||||
|
Loading…
Reference in New Issue
Block a user