-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem to duplicate image inline #34
Comments
We don't copy the files, the new model will have paths to the same files are the original one. Maybe you can override |
ok thanks. After clicked duplicate I see file link to my record but when I click Save I got validation error with files. I will check save_model thanks. |
The method save_model() isn't execute in this case. |
Seems like this happens when the image field is required, so form does not validate in the start of class ModelAdmin(modelclone.ClonableModelAdmin):
def get_form(self, request, *args, **kwargs):
form = super().get_form(request, *args, **kwargs)
if 'clone' in request.path:
form.base_fields['my_image_field'].required = False
return form |
Hi, I have some images in inline in my admin form and when I use Duplicate button it does not copy any images. Do you have any solution for this?
The text was updated successfully, but these errors were encountered: