def save_employer(request): if not get_object_or_none(Developer, pk=request.user.pk): dev = Developer() dev.pk = request.user.pk dev.user = request.user dev.first_name = request.user.first_name dev.last_name = request.user.last_name dev.email_address = request.user.email dev.is_developer = True dev.save()
def home(request): context = RequestContext(request,{'request':request,'user':request.user}) dev_id = None try: dev_id = Developer.objects.get(pk=request.user.pk) except: print('User does not exist') dev = Developer() if not dev_id: dev.pk = request.user.pk dev.first_name = request.user.first_name dev.last_name = request.user.last_name dev.email_address = request.user.email dev.is_developer = True dev.save() return render_to_response('home.html',context_instance=context)