Skip to content

Commit

Permalink
fix: default commodity callable work on existing databases
Browse files Browse the repository at this point in the history
  • Loading branch information
ngurenyaga committed Aug 19, 2021
1 parent c387b41 commit fd16f48
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fahari/ops/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from django.utils import timezone

from fahari.common.models import AbstractBase, Facility, Organisation, System
from fahari.users.models import default_organisation

User = get_user_model()

Expand Down Expand Up @@ -39,7 +38,7 @@ def default_commodity():
com, _ = Commodity.objects.get_or_create(
code=DEFAULT_COMMODITY_CODE,
defaults={
"organisation": Organisation.objects.get(pk=default_organisation()),
"organisation": Organisation.objects.first(),
"pk": DEFAULT_COMMODITY_PK,
"name": DEFAULT_COMMODITY_NAME,
},
Expand Down

0 comments on commit fd16f48

Please sign in to comment.