Skip to content

Commit

Permalink
added a wsgi file for running on apache
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmundy committed Jul 25, 2016
1 parent e9618d6 commit bdaa722
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 14 additions & 1 deletion api/v1/endpoints.py
Expand Up @@ -409,9 +409,22 @@ class AssociatedSkillsForJobEndpoint(Resource):
def get(self, id=None):
if id is not None:
results = JobSkill.query.filter_by(job_uuid = id).all()
job = JobMaster.query.filter_by(uuid = id).first()
if not results:
parent_uuid = None
job = JobAlternateTitle.query.filter_by(uuid = id).first()
if job:
parent_uuid = job.job_uuid
else:
job = JobUnusualTitle.query.filter_by(uuid = id).first()
if job:
parent_uuid = job.job_uuid

if parent_uuid is not None:
results = JobSkill.query.filter_by(job_uuid = parent_uuid).all()

if len(results) > 0:
all_skills = OrderedDict()
job = JobMaster.query.filter_by(uuid = id).first()
all_skills['job_uuid'] = id
all_skills['job_title'] = job.title
all_skills['normalized_job_title'] = job.nlp_a
Expand Down
6 changes: 6 additions & 0 deletions openskills.wsgi
@@ -0,0 +1,6 @@
import sys
sys.path.append('/var/www/skills-api')
activate_this = '/var/www/skills-api/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))

from app.app import app as application

0 comments on commit bdaa722

Please sign in to comment.