Skip to content

Commit

Permalink
Update clone.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Jun 24, 2021
1 parent 82ee088 commit fa606f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model_clone/mixins/clone.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def _create_copy_of_instance(instance, using=None, force=False, sub_clone=False)
)

elif isinstance(f, models.OneToOneField) and not sub_clone:
sub_instance = getattr(instance, f.name, f.get_default())
sub_instance = getattr(instance, f.name, None) or f.get_default()

if sub_instance is not None:
sub_instance = CloneMixin._create_copy_of_instance(
Expand Down

0 comments on commit fa606f3

Please sign in to comment.