def resource_create_step1_view(request):
    if request.user.is_anonymous():
        return render(request, 'orb/login_required.html', {
            'message': _(u'You need to be logged in to add a resource.'),
        })

    if request.method == 'POST':
        form = ResourceStep1Form(request.POST, request.FILES, request=request)
        resource_form_set_choices(form)
        if form.is_valid():
            # save resource
            resource = Resource(status=Resource.PENDING,
                                create_user=request.user, update_user=request.user)
            resource.title = form.cleaned_data.get("title")
            resource.description = form.cleaned_data.get("description")
            if form.cleaned_data.get("study_time_number") and form.cleaned_data.get("study_time_unit"):
                resource.study_time_number = form.cleaned_data.get(
                    "study_time_number")
                resource.study_time_unit = form.cleaned_data.get(
                    "study_time_unit")
            if request.FILES.has_key('image'):
                resource.image = request.FILES["image"]
            resource.attribution = form.cleaned_data.get("attribution")
            resource.save()

            # add organisation(s)/geography and other tags
            resource_add_free_text_tags(
                resource, form.cleaned_data.get('organisations'), request.user, 'organisation')
            resource_add_free_text_tags(
                resource, form.cleaned_data.get('geography'), request.user, 'geography')
            resource_add_free_text_tags(
                resource, form.cleaned_data.get('languages'), request.user, 'language')
            resource_add_free_text_tags(
                resource, form.cleaned_data.get('other_tags'), request.user, 'other')

            # add tags
            resource_add_tags(request, form, resource)

            # see if email needs to be sent
            resource_workflow.send(sender=resource, resource=resource, request=request,
                                   status=Resource.PENDING, notes="")
            resource_submitted.send(sender=resource, resource=resource, request=request)

            # redirect to step 2
            # Redirect after POST
            return HttpResponseRedirect(reverse('orb_resource_create2', args=[resource.id]))

    else:
        if request.user.userprofile.organisation:
            user_org = request.user.userprofile.organisation.name
            initial = {'organisations': user_org, }
        else:
            initial = {}
        form = ResourceStep1Form(initial=initial, request=request)
        resource_form_set_choices(form)

    return render(request, 'orb/resource/create_step1.html', {'form': form})