|
@@ -762,8 +762,8 @@ class ImageAttachmentEditView(generic.ObjectEditView):
|
|
|
def alter_object(self, instance, request, args, kwargs):
|
|
def alter_object(self, instance, request, args, kwargs):
|
|
|
if not instance.pk:
|
|
if not instance.pk:
|
|
|
# Assign the parent object based on URL kwargs
|
|
# Assign the parent object based on URL kwargs
|
|
|
- content_type = get_object_or_404(ContentType, pk=request.GET.get('content_type'))
|
|
|
|
|
- instance.parent = get_object_or_404(content_type.model_class(), pk=request.GET.get('object_id'))
|
|
|
|
|
|
|
+ object_type = get_object_or_404(ContentType, pk=request.GET.get('object_type'))
|
|
|
|
|
+ instance.parent = get_object_or_404(object_type.model_class(), pk=request.GET.get('object_id'))
|
|
|
return instance
|
|
return instance
|
|
|
|
|
|
|
|
def get_return_url(self, request, obj=None):
|
|
def get_return_url(self, request, obj=None):
|
|
@@ -771,7 +771,7 @@ class ImageAttachmentEditView(generic.ObjectEditView):
|
|
|
|
|
|
|
|
def get_extra_addanother_params(self, request):
|
|
def get_extra_addanother_params(self, request):
|
|
|
return {
|
|
return {
|
|
|
- 'content_type': request.GET.get('content_type'),
|
|
|
|
|
|
|
+ 'object_type': request.GET.get('object_type'),
|
|
|
'object_id': request.GET.get('object_id'),
|
|
'object_id': request.GET.get('object_id'),
|
|
|
}
|
|
}
|
|
|
|
|
|