Skip to content

Instantly share code, notes, and snippets.

@josephmisiti
Created August 20, 2012 23:02
Show Gist options
  • Save josephmisiti/3408960 to your computer and use it in GitHub Desktop.
Save josephmisiti/3408960 to your computer and use it in GitHub Desktop.
@login_required
def employee_create(request, employee_id):
applicant = MHRBoxApplicant.objects.get(account_id=employee_id)
job = MHRBoxJob.objects.get(id=applicant.job.id)
try:
employee = MHRBoxEmployee.objects.get(unique_id=employee_id,job=job)
except MHRBoxEmployee.DoesNotExist:
logging.debug('Created new hrbox employee ~ apps.hrbox.views.employee')
info = {}
info['general'] = {}
info['general'] = applicant.info
info['resumepath'] = applicant.resumepath
info['coverpath'] = applicant.coverpath
employee = MHRBoxEmployee.objects.create(unique_id=employee_id,job=job,info=info)
employee.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment