Skip to content

Commit

Permalink
Merge pull request #114 from massenergize/April-Sprint2-Part2
Browse files Browse the repository at this point in the history
April sprint2 part2
  • Loading branch information
Opoku-Agyemang authored Apr 22, 2020
2 parents 8565b13 + 09fb820 commit 7703cbd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml
.env
dev.env
prod.env
.ebextensions/securelistener-clb.config
prepare-for-deploy.py
6 changes: 5 additions & 1 deletion src/_main_/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,18 @@
from firebase_admin import credentials
from .utils.utils import load_json
from dotenv import load_dotenv
load_dotenv()
from pathlib import Path # python3 only

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

# ******** LOAD CONFIG DATA ***********#
IS_PROD = False

env_path = Path('.') / ('prod.env' if IS_PROD else 'dev.env')
load_dotenv(dotenv_path=env_path, verbose=True)


# os.environ.update(CONFIG_DATA)
# ******** END LOAD CONFIG DATA ***********#

Expand Down
4 changes: 4 additions & 0 deletions src/database/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,8 @@ def simple_json(self):
data['communities'] = [c.simple_json() for c in self.communities.all()]
data['tags'] = [t.simple_json() for t in self.tags.all()]
data['logo'] = get_json_if_not_none(self.logo)
data['website'] = self.more_info and self.more_info.get('website', None)
data['key_contact'] = self.key_contact
return data


Expand All @@ -906,6 +908,7 @@ def full_json(self):
data['services'] = [s.simple_json() for s in self.services.all()]
data['communities'] = [c.simple_json() for c in self.communities.all()]
data['website'] = self.more_info and self.more_info.get('website', None)
data['key_contact'] = self.key_contact
return data

class Meta:
Expand Down Expand Up @@ -2150,6 +2153,7 @@ def simple_json(self):
res = model_to_dict(self)
res["community"] = get_summary_info(self.community)
res["team"] = get_summary_info(self.team)
res["user"] = get_summary_info(self.user)
return res

def full_json(self):
Expand Down

0 comments on commit 7703cbd

Please sign in to comment.