Skip to content

Commit

Permalink
Merge pull request #95 from openimis/hotfix/OMT-281_HFID_main
Browse files Browse the repository at this point in the history
OMT-281 follow-up when HFID is 0
  • Loading branch information
edarchis committed Dec 23, 2021
2 parents 3496f9c + 90624c8 commit ee9aa47
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,12 @@ def rights_str(self):
return [str(r) for r in self.rights]

@cached_property
def get_health_facility(self):
def health_facility(self):
if self.health_facility_id:
hf_model = apps.get_model("location", "HealthFacility")
if hf_model:
return hf_model.objects.filter(pk=self.health_facility_id).first()
return None

def set_password(self, raw_password):
from hashlib import sha256
Expand Down Expand Up @@ -507,7 +508,7 @@ def get_health_facility(self):
if self.claim_admin:
return self.claim_admin.health_facility
if self.i_user:
return self.i_user.get_health_facility()
return self.i_user.health_facility
return None

def __getattr__(self, name):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='openimis-be-core',
version='1.3.1',
version='1.3.3',
packages=find_packages(),
include_package_data=True,
license='GNU AGPL v3',
Expand Down

0 comments on commit ee9aa47

Please sign in to comment.