Exemple #1
0
def hr_application_create_view(request):
    logger.debug("hr_application_create_view called by user %s" % request.user)
    success = False

    if request.method == 'POST':
        form = HRApplicationForm(request.POST)
        logger.debug("Request type POST with form valid: %s" % form.is_valid())
        if form.is_valid():
            application = HRApplication()
            application.user = request.user
            application.character_name = form.cleaned_data['character_name']
            application.full_api_id = form.cleaned_data['full_api_id']
            application.full_api_key = form.cleaned_data['full_api_key']
            application.corp = EveCorporationInfo.objects.get(corporation_id=form.cleaned_data['corp'])
            application.is_a_spi = form.cleaned_data['is_a_spi']
            application.about = form.cleaned_data['about']
            application.extra = form.cleaned_data['extra']
            application.save()
            success = True
            logger.info("Created HRApplication for user %s to corp %s" % (request.user, application.corp))
    else:
        logger.debug("Providing empty form.")
        form = HRApplicationForm()

    context = {'form': form, 'success': success}
    return render_to_response('registered/hrcreateapplication.html',
                              context, context_instance=RequestContext(request))
Exemple #2
0
def hr_application_create_view(request):
    logger.debug("hr_application_create_view called by user %s" % request.user)
    success = False

    if request.method == 'POST':
        form = HRApplicationForm(request.POST)
        logger.debug("Request type POST with form valid: %s" % form.is_valid())
        if form.is_valid():
            application = HRApplication()
            application.user = request.user
            application.character_name = form.cleaned_data['character_name']
            application.full_api_id = form.cleaned_data['full_api_id']
            application.full_api_key = form.cleaned_data['full_api_key']
            application.corp = EveCorporationInfo.objects.get(
                corporation_id=form.cleaned_data['corp'])
            application.is_a_spi = form.cleaned_data['is_a_spi']
            application.about = form.cleaned_data['about']
            application.extra = form.cleaned_data['extra']
            application.save()
            success = True
            logger.info("Created HRApplication for user %s to corp %s" %
                        (request.user, application.corp))
    else:
        logger.debug("Providing empty form.")
        form = HRApplicationForm()

    context = {'form': form, 'success': success}
    return render_to_response('registered/hrcreateapplication.html',
                              context,
                              context_instance=RequestContext(request))
Exemple #3
0
def hr_application_create_view(request):
	success = False

	if request.method == 'POST':
		form = HRApplicationForm(request.POST)
		if form.is_valid():
			application = HRApplication()
			application.user = request.user
			application.character_name = form.cleaned_data['character_name']
			application.full_api_id = form.cleaned_data['full_api_id']
			application.full_api_key = form.cleaned_data['full_api_key']
			application.corp = EveCorporationInfo.objects.get(corporation_id=form.cleaned_data['corp'])
			application.is_a_spi = form.cleaned_data['is_a_spi']
			application.about = form.cleaned_data['about']
			application.extra = form.cleaned_data['extra']
			application.save()
			success = True
	else:
		form = HRApplicationForm()

	context = {'form': form, 'success': success}
	return render_to_response('registered/hrcreateapplication.html',
							  context, context_instance=RequestContext(request))