Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from swist/bugfix/providing-defaults-on-migration
Browse files Browse the repository at this point in the history
Try to fix this nonsense better
  • Loading branch information
swist authored Dec 5, 2019
2 parents 0efe317 + cb8fa07 commit 2b17b2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions django_types/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ def get_dependencies(self):
dep_app_label = "__setting__"
dep_object_name = swappable_setting
else:
dep_app_label = self.related_model._meta.app_label
dep_object_name = self.related_model._meta.object_name
try:
dep_app_label = self.related_model._meta.app_label
dep_object_name = self.related_model._meta.object_name
except AttributeError:
dep_app_label, dep_object_name = self.deconstruct()[-1]['to'].split('.')
# Depend on the model that this refers to
dependencies.append(dependency_tuple(
app_label=dep_app_label,
Expand Down

0 comments on commit 2b17b2e

Please sign in to comment.