Example #1
0
def edit_advert(request, advert_id):
    adv = Advert.objects.get(pk=advert_id)
    contact = ContactInfo.objects.get(pk=adv.contact.id)
    if request.method == 'POST':
        advertform = AdvertForm(request.POST, request.FILES, instance=adv)
        contactform = ContactInfoForm(request.POST, request.FILES, instance=contact)
        if advertform.is_valid() and contactform.is_valid():
            newadvert = advertform.save(commit=False)
            newadvert.planning = unicode(newadvert.planning)
            newadvert.poster = unicode(newadvert.poster)
            #realtypeid = request.POST['realtype']
            realtypeid = 2
            newadvert.realtype = RealType.objects.get(pk=realtypeid) 
            streetid = request.POST['street']
            newadvert.street = Street.objects.get(pk=streetid)
            newadvert.save()
            newadvert.save_m2m()
            contact = contactform.save()
            contact.save()
            return HttpResponseRedirect('/advert/%s/' % advert_id)
            
    else:
	advertform = AdvertForm(instance=adv,error_class=DivErrorList)
	contactform = ContactInfoForm(instance=contact,error_class=DivErrorList)
    return {
            'form': advertform,
    	    'contactform':contactform,
            'logform': RegistrationFormUniqueEmail,
    }
Example #2
0
def new_advert(request):
    if request.method == 'POST':
        advertform = AdvertForm(request.POST, request.FILES)
        contactform = ContactInfoForm(request.POST, request.FILES)
        if advertform.is_valid() and contactform.is_valid():
            newadvert = advertform.save(commit=False)
            newadvert.planning = newadvert.planning
            newadvert.poster = newadvert.poster
            newadvert.user = request.user
            newadvert.contact = contactform.save()
            newadvert.save()
            newadvert.save_m2m()
            return HttpResponseRedirect('/advert/thanks/')
    else:
        advertform = AdvertForm(
            initial = {'user':request.user},
            error_class=DivErrorList,
#            instance='advert_add',
        )
        contactform = ContactInfoForm(
            error_class=DivErrorList,
#            instance='contact_from',
        )
        
    return {
        'form': advertform,
        'contactform':contactform,
        'logform': RegistrationFormUniqueEmail,
    }
Example #3
0
def publisher_settings_payment(request):
    ''' View to edit a Publishers Payment Settings '''
    from atrinsic.base.models import OrganizationContacts, OrganizationPaymentInfo
    from forms import ContactInfoForm, PaymentInfoForm
    global_err = ''
    
    if request.method == 'POST':
        formPI = PaymentInfoForm(request.POST)
        formCI = ContactInfoForm(request.POST)
        if formPI.is_valid():
            OrganizationPaymentInfo.objects.filter(organization=request.organization).update(**formPI.cleaned_data)
            if formPI.cleaned_data['payment_method'] == PAYMENT_CHECK:
                if formCI.is_valid():
                    OrganizationContacts.objects.filter(organization=request.organization).update(**formCI.cleaned_data)
                else:              
                    return AQ_render_to_response(request, 'publisher/settings/payment-edit.html', {
                        'formPI': formPI,
                        'formCI': formCI,
                        'global_err' : global_err
                        }, context_instance=RequestContext(request))
            return HttpResponseRedirect(reverse('publisher_settings_payment'))
        else:
            global_err = formCI.errors
            print global_err
    else:
        try:
            formPI = PaymentInfoForm(instance = OrganizationPaymentInfo.objects.get(organization=request.organization))
            formCI = ContactInfoForm(instance = OrganizationContacts.objects.get(organization=request.organization))
        except:
            formPI = PaymentInfoForm()
            formCI = ContactInfoForm()
            
    return AQ_render_to_response(request, 'publisher/settings/payment-edit.html', {
        'formPI': formPI,
        'formCI': formCI,
        'global_err' : global_err
        }, context_instance=RequestContext(request))
Example #4
0
def publisher_settings_payment(request):
    ''' View to edit a Publishers Payment Settings '''
    from atrinsic.base.models import OrganizationContacts, OrganizationPaymentInfo
    from forms import ContactInfoForm, PaymentInfoForm
    global_err = ''

    if request.method == 'POST':
        formPI = PaymentInfoForm(request.POST)
        formCI = ContactInfoForm(request.POST)
        if formPI.is_valid():
            OrganizationPaymentInfo.objects.filter(
                organization=request.organization).update(
                    **formPI.cleaned_data)
            if formPI.cleaned_data['payment_method'] == PAYMENT_CHECK:
                if formCI.is_valid():
                    OrganizationContacts.objects.filter(
                        organization=request.organization).update(
                            **formCI.cleaned_data)
                else:
                    return AQ_render_to_response(
                        request,
                        'publisher/settings/payment-edit.html', {
                            'formPI': formPI,
                            'formCI': formCI,
                            'global_err': global_err
                        },
                        context_instance=RequestContext(request))
            return HttpResponseRedirect(reverse('publisher_settings_payment'))
        else:
            global_err = formCI.errors
            print global_err
    else:
        try:
            formPI = PaymentInfoForm(
                instance=OrganizationPaymentInfo.objects.get(
                    organization=request.organization))
            formCI = ContactInfoForm(instance=OrganizationContacts.objects.get(
                organization=request.organization))
        except:
            formPI = PaymentInfoForm()
            formCI = ContactInfoForm()

    return AQ_render_to_response(request,
                                 'publisher/settings/payment-edit.html', {
                                     'formPI': formPI,
                                     'formCI': formCI,
                                     'global_err': global_err
                                 },
                                 context_instance=RequestContext(request))
Example #5
0
def signup_publisher_step4(request):
    ''' Fourth step of publisher signup process, confirms the email'''
    from forms import PublisherSignupForm3,WebsiteForm,PaymentInfoForm,ContactInfoForm, ContactInfoFormSmallest
    from atrinsic.util.user import generate_username
    from atrinsic.base.models import PublisherApplication,Organization,Website,OrganizationContacts,OrganizationPaymentInfo,User,UserProfile

    if request.method == "GET":
        if request.GET.get("id",None) and request.GET.get("key",None):
            if PublisherApplication.objects.filter(validation_code=request.GET['key'],id=request.GET['id']).count() > 0:
                app = PublisherApplication.objects.filter(validation_code=request.GET['key'],id=request.GET['id'])[0]
                form = PublisherSignupForm3(False)
                website_form = WebsiteForm()
                payment_form = PaymentInfoForm()   
                print app.email
                inits = { 'payeename':'', 
                          'firstname':'', 
                          'lastname':'', 
                          'phone':'', 
                          'email': app.email, }
                formCI = ContactInfoForm(initial=inits)
                inits = { 'xs_firstname':'', 
                          'xs_lastname':'', 
                          'xs_email': app.email, }
                formCIxs = ContactInfoFormSmallest(initial=inits)
                key = request.GET['key']
                appid = request.GET['id']
                
                return AQ_render_to_response(request, 'signup/publisher_newStep.html', {
                 'payment_form':payment_form,
                 'formCI' : formCI,
                 'formCIxs' : formCIxs,
                 'website_form':website_form,
                 'form' : form,
                 'key' : key,
                 'appid' : appid,
                    }, context_instance=RequestContext(request))
            else:
                #application could not be found
                return AQ_render_to_response(request, 'signup/appnotfound.html', {
                    }, context_instance=RequestContext(request))        
        else:
            return AQ_render_to_response(request, 'signup/publisher_step4.html', {
                    }, context_instance=RequestContext(request))        
    else:

        form = PublisherSignupForm3(False,request.POST)
        website_form = WebsiteForm(request.POST)
        payment_form = PaymentInfoForm(request.POST)
        formCI = ContactInfoForm(request.POST)
        formCIxs = ContactInfoFormSmallest(request.POST)
        key = request.POST['key']
        appid = request.POST['appid']
        
        if form.is_valid() and website_form.is_valid() and  payment_form.is_valid():
            useSmallContactForm = True
            if payment_form.cleaned_data['payment_method'] == PAYMENT_CHECK:
                if formCI.is_valid():
                    useSmallContactForm = False
                else:
                    #1 or more forms are not valid
                    return AQ_render_to_response(request, 'signup/publisher_newStep.html', {
                         'payment_form':payment_form,
                         'formCI' : formCI,
                         'formCIxs' : formCIxs,
                         'website_form':website_form,
                         'form' : form,
                         'key' : key,
                         'appid' : appid,
                            }, context_instance=RequestContext(request))
            else:
                if formCIxs.is_valid():
                    useSmallContactForm = True
                else:
                    #1 or more forms are not valid
                    return AQ_render_to_response(request, 'signup/publisher_newStep.html', {
                         'payment_form':payment_form,
                         'formCI' : formCI,
                         'formCIxs' : formCIxs,
                         'website_form':website_form,
                         'form' : form,
                         'key' : key,
                         'appid' : appid,
                            }, context_instance=RequestContext(request))
            #create Organization
           
            org = Organization.objects.create(org_type=ORGTYPE_PUBLISHER, status=ORGSTATUS_UNAPPROVED)

            org.company_name = form.cleaned_data['company_name']
            org.address = form.cleaned_data['pub_address']
            org.address2 = form.cleaned_data['pub_address2']
            org.city = form.cleaned_data['pub_city']
            org.state = form.cleaned_data['pub_state']
            org.zipcode = form.cleaned_data['pub_zipcode']
            org.country = form.cleaned_data['pub_country']
            if str(website_form.cleaned_data['vertical']) == "Adult":
                org.is_adult = 1
            org.save()
            
            if useSmallContactForm:     
                org_contact = OrganizationContacts.objects.create(organization=org, firstname=formCIxs.cleaned_data['xs_firstname'],lastname=formCIxs.cleaned_data['xs_lastname'],email=formCIxs.cleaned_data['xs_email'])
                org_contact.save()       
            else:        
                org_contact = OrganizationContacts.objects.create(organization=org, **formCI.cleaned_data)
                org_contact.save()
                address = formCI.cleaned_data['address']        
            app = PublisherApplication.objects.filter(validation_code=key,id=appid)[0]
            
            try:
                term_log = Terms_Accepted_Log.objects.get(organization_id=app)
                term_log.organization_id = org.id
                term_log.save()
            except:
                pass
            
            address = ""                
            website = Website.objects.create(publisher = org, is_default = True, **website_form.cleaned_data)
            website.save()
            org_payment = OrganizationPaymentInfo.objects.create(organization=org, **payment_form.cleaned_data)
            org_payment.save()
            
            first_name = app.first_name
            last_name = app.last_name
            password = app.password
            
            if useSmallContactForm:     
                email=formCIxs.cleaned_data['xs_email']
            else:      
                email=formCI.cleaned_data['email']
                            
            if payment_form.cleaned_data['payment_method'] == PAYMENT_CHECK:
                payee_name = formCI.cleaned_data['payeename']
                first_name = formCI.cleaned_data['firstname']
                last_name = formCI.cleaned_data['lastname']
            
            
            # Create User, Set Password, Map to Organization            
            u = User.objects.create(first_name=first_name,last_name=last_name,password=password,email=email, username=generate_username(email))
            up = UserProfile.objects.create(user=u)
            up.organizations.add(org)
            
            # Assign all ADMINLEVEL_ADMINISTRATOR to this
            for up in UserProfile.objects.filter(admin_level=ADMINLEVEL_ADMINISTRATOR):
                up.admin_assigned_organizations.add(org)
                up.save()
               
            #Emails
            from django.core.mail import EmailMultiAlternatives
            print "Sending mail"
            msg = EmailMultiAlternatives("Atrinsic Affiliate Network  Publisher Application", u"""
Dear """+first_name[0:1].upper()+first_name[1:]+""" """+last_name[0:1].upper()+last_name[1:]+""",

Thank you for applying to become a publisher on the Atrinsic Affiliate Network.

Your application has been placed in our queue and will be reviewed as quickly as possible.  You will be contacted shortly by a member of the Atrinsic Affiliate Network Publisher team to verify some information on your application.
If, at any time, you have questions or concerns, please contact us at [email protected].

We receive a large volume of applications each day and your application will be processed in the order in which it was received.


Thank you for your interest in working with Atrinsic Affiliate Network!

Sincerely,

The Atrinsic Affiliate Network Publisher Team

""","*****@*****.**",[email])

            msg.send()
            
            themessage = u"""Dear Admin! this is a glorious day, a new publisher has join our ranks.
            Name: """+first_name[0:1].upper()+first_name[1:]+""" """+last_name[0:1].upper()+last_name[1:]
            themessage += """
            Address: """+address+"""
            Email: """+email+"""
            Website URL: """+website_form.cleaned_data['url']+"""
            
            please review this application,
            
            Sincerely,
            
            The Atrinsic Affiliate Network Robot that sends email"""
                
            msg2 = EmailMultiAlternatives("Atrinsic Affiliate Network Publisher Application",themessage,"*****@*****.**",['*****@*****.**'])
            msg2.send()    
                     
            return AQ_render_to_response(request, 'signup/publisher_complete.html', {
        }, context_instance=RequestContext(request))
        
        else:
            #1 or more forms are not valid
            return AQ_render_to_response(request, 'signup/publisher_newStep.html', {
                 'payment_form':payment_form,
                 'formCI' : formCI,
                 'formCIxs' : formCIxs,
                 'website_form':website_form,
                 'form' : form,
                 'key' : key,
                 'appid' : appid,
                    }, context_instance=RequestContext(request))
Example #6
0
def signup_publisher_step4(request):
    ''' Fourth step of publisher signup process, confirms the email'''
    from forms import PublisherSignupForm3, WebsiteForm, PaymentInfoForm, ContactInfoForm, ContactInfoFormSmallest
    from atrinsic.util.user import generate_username
    from atrinsic.base.models import PublisherApplication, Organization, Website, OrganizationContacts, OrganizationPaymentInfo, User, UserProfile

    if request.method == "GET":
        if request.GET.get("id", None) and request.GET.get("key", None):
            if PublisherApplication.objects.filter(
                    validation_code=request.GET['key'],
                    id=request.GET['id']).count() > 0:
                app = PublisherApplication.objects.filter(
                    validation_code=request.GET['key'],
                    id=request.GET['id'])[0]
                form = PublisherSignupForm3(False)
                website_form = WebsiteForm()
                payment_form = PaymentInfoForm()
                print app.email
                inits = {
                    'payeename': '',
                    'firstname': '',
                    'lastname': '',
                    'phone': '',
                    'email': app.email,
                }
                formCI = ContactInfoForm(initial=inits)
                inits = {
                    'xs_firstname': '',
                    'xs_lastname': '',
                    'xs_email': app.email,
                }
                formCIxs = ContactInfoFormSmallest(initial=inits)
                key = request.GET['key']
                appid = request.GET['id']

                return AQ_render_to_response(
                    request,
                    'signup/publisher_newStep.html', {
                        'payment_form': payment_form,
                        'formCI': formCI,
                        'formCIxs': formCIxs,
                        'website_form': website_form,
                        'form': form,
                        'key': key,
                        'appid': appid,
                    },
                    context_instance=RequestContext(request))
            else:
                #application could not be found
                return AQ_render_to_response(
                    request,
                    'signup/appnotfound.html', {},
                    context_instance=RequestContext(request))
        else:
            return AQ_render_to_response(
                request,
                'signup/publisher_step4.html', {},
                context_instance=RequestContext(request))
    else:

        form = PublisherSignupForm3(False, request.POST)
        website_form = WebsiteForm(request.POST)
        payment_form = PaymentInfoForm(request.POST)
        formCI = ContactInfoForm(request.POST)
        formCIxs = ContactInfoFormSmallest(request.POST)
        key = request.POST['key']
        appid = request.POST['appid']

        if form.is_valid() and website_form.is_valid(
        ) and payment_form.is_valid():
            useSmallContactForm = True
            if payment_form.cleaned_data['payment_method'] == PAYMENT_CHECK:
                if formCI.is_valid():
                    useSmallContactForm = False
                else:
                    #1 or more forms are not valid
                    return AQ_render_to_response(
                        request,
                        'signup/publisher_newStep.html', {
                            'payment_form': payment_form,
                            'formCI': formCI,
                            'formCIxs': formCIxs,
                            'website_form': website_form,
                            'form': form,
                            'key': key,
                            'appid': appid,
                        },
                        context_instance=RequestContext(request))
            else:
                if formCIxs.is_valid():
                    useSmallContactForm = True
                else:
                    #1 or more forms are not valid
                    return AQ_render_to_response(
                        request,
                        'signup/publisher_newStep.html', {
                            'payment_form': payment_form,
                            'formCI': formCI,
                            'formCIxs': formCIxs,
                            'website_form': website_form,
                            'form': form,
                            'key': key,
                            'appid': appid,
                        },
                        context_instance=RequestContext(request))
            #create Organization

            org = Organization.objects.create(org_type=ORGTYPE_PUBLISHER,
                                              status=ORGSTATUS_UNAPPROVED)

            org.company_name = form.cleaned_data['company_name']
            org.address = form.cleaned_data['pub_address']
            org.address2 = form.cleaned_data['pub_address2']
            org.city = form.cleaned_data['pub_city']
            org.state = form.cleaned_data['pub_state']
            org.zipcode = form.cleaned_data['pub_zipcode']
            org.country = form.cleaned_data['pub_country']
            if str(website_form.cleaned_data['vertical']) == "Adult":
                org.is_adult = 1
            org.save()

            if useSmallContactForm:
                org_contact = OrganizationContacts.objects.create(
                    organization=org,
                    firstname=formCIxs.cleaned_data['xs_firstname'],
                    lastname=formCIxs.cleaned_data['xs_lastname'],
                    email=formCIxs.cleaned_data['xs_email'])
                org_contact.save()
            else:
                org_contact = OrganizationContacts.objects.create(
                    organization=org, **formCI.cleaned_data)
                org_contact.save()
                address = formCI.cleaned_data['address']
            app = PublisherApplication.objects.filter(validation_code=key,
                                                      id=appid)[0]

            try:
                term_log = Terms_Accepted_Log.objects.get(organization_id=app)
                term_log.organization_id = org.id
                term_log.save()
            except:
                pass

            address = ""
            website = Website.objects.create(publisher=org,
                                             is_default=True,
                                             **website_form.cleaned_data)
            website.save()
            org_payment = OrganizationPaymentInfo.objects.create(
                organization=org, **payment_form.cleaned_data)
            org_payment.save()

            first_name = app.first_name
            last_name = app.last_name
            password = app.password

            if useSmallContactForm:
                email = formCIxs.cleaned_data['xs_email']
            else:
                email = formCI.cleaned_data['email']

            if payment_form.cleaned_data['payment_method'] == PAYMENT_CHECK:
                payee_name = formCI.cleaned_data['payeename']
                first_name = formCI.cleaned_data['firstname']
                last_name = formCI.cleaned_data['lastname']

            # Create User, Set Password, Map to Organization
            u = User.objects.create(first_name=first_name,
                                    last_name=last_name,
                                    password=password,
                                    email=email,
                                    username=generate_username(email))
            up = UserProfile.objects.create(user=u)
            up.organizations.add(org)

            # Assign all ADMINLEVEL_ADMINISTRATOR to this
            for up in UserProfile.objects.filter(
                    admin_level=ADMINLEVEL_ADMINISTRATOR):
                up.admin_assigned_organizations.add(org)
                up.save()

            #Emails
            from django.core.mail import EmailMultiAlternatives
            print "Sending mail"
            msg = EmailMultiAlternatives(
                "Atrinsic Affiliate Network  Publisher Application", u"""
Dear """ + first_name[0:1].upper() + first_name[1:] + """ """ +
                last_name[0:1].upper() + last_name[1:] + """,

Thank you for applying to become a publisher on the Atrinsic Affiliate Network.

Your application has been placed in our queue and will be reviewed as quickly as possible.  You will be contacted shortly by a member of the Atrinsic Affiliate Network Publisher team to verify some information on your application.
If, at any time, you have questions or concerns, please contact us at [email protected].

We receive a large volume of applications each day and your application will be processed in the order in which it was received.


Thank you for your interest in working with Atrinsic Affiliate Network!

Sincerely,

The Atrinsic Affiliate Network Publisher Team

""", "*****@*****.**", [email])

            msg.send()

            themessage = u"""Dear Admin! this is a glorious day, a new publisher has join our ranks.
            Name: """ + first_name[0:1].upper() + first_name[
                1:] + """ """ + last_name[0:1].upper() + last_name[1:]
            themessage += """
            Address: """ + address + """
            Email: """ + email + """
            Website URL: """ + website_form.cleaned_data['url'] + """
            
            please review this application,
            
            Sincerely,
            
            The Atrinsic Affiliate Network Robot that sends email"""

            msg2 = EmailMultiAlternatives(
                "Atrinsic Affiliate Network Publisher Application", themessage,
                "*****@*****.**",
                ['*****@*****.**'])
            msg2.send()

            return AQ_render_to_response(
                request,
                'signup/publisher_complete.html', {},
                context_instance=RequestContext(request))

        else:
            #1 or more forms are not valid
            return AQ_render_to_response(
                request,
                'signup/publisher_newStep.html', {
                    'payment_form': payment_form,
                    'formCI': formCI,
                    'formCIxs': formCIxs,
                    'website_form': website_form,
                    'form': form,
                    'key': key,
                    'appid': appid,
                },
                context_instance=RequestContext(request))
Example #7
0
def network_publisher_create(request,oid=None):
    from atrinsic.base.models import Organization,Website,OrganizationContacts,OrganizationPaymentInfo,UserProfile,User
    from forms import PublisherSignupForm2,PublisherSignupForm3,PaymentInfoForm,ContactInfoForm,WebsiteForm

    if request.POST:
        update = False
        if oid:
            org = Organization.objects.get(pk=oid)
            update = True
            
        form_step2 = PublisherSignupForm2(update, request.POST)
        form_step3 = PublisherSignupForm3(update, request.POST)
        form_payment = PaymentInfoForm(request.POST)
        form_contact_info = ContactInfoForm(request.POST)
        website_form = WebsiteForm(request.POST)
        
        if form_step2.is_valid() & form_step3.is_valid() & form_payment.is_valid() & form_contact_info.is_valid() & website_form.is_valid():
            if oid:
                org = Organization.objects.get(pk=oid)
            else:
                org = Organization.objects.create(org_type=ORGTYPE_PUBLISHER, status=ORGSTATUS_UNAPPROVED)
           
            org.company_name = form_step3.cleaned_data['company_name']
            org.address = form_step3.cleaned_data['pub_address']
            org.address2 = form_step3.cleaned_data['pub_address2']
            org.city = form_step3.cleaned_data['pub_city']
            org.state = form_step3.cleaned_data['pub_state']
            org.zipcode = form_step3.cleaned_data['pub_zipcode']
            org.country = form_step3.cleaned_data['pub_country']
            org.save()     
                
                
            if update:
                website = Website.objects.filter(publisher=org,is_default=True).update(**website_form.cleaned_data)
                org_contact = OrganizationContacts.objects.filter(organization=org).update(**form_contact_info.cleaned_data)
                org_payment = OrganizationPaymentInfo.objects.filter(organization=org).update(**form_payment.cleaned_data)
                '''
                user_form_cleaned = form_step2.cleaned_data
                del user_form_cleaned['password2']
                up = UserProfile.objects.get(organizations=org)
                up.user.first_name=user_form_cleaned['first_name']
                up.user.last_name=user_form_cleaned['last_name']
                up.user.email=user_form_cleaned['email']
                up.user.username=user_form_cleaned['username']
                if user_form_cleaned['password']:
                    up.user.set_password(user_form_cleaned['password'])
                up.user.save()
                up.save()
                '''
            else:
                website = Website.objects.create(publisher = org, is_default = True, **website_form.cleaned_data)
                org_contact = OrganizationContacts.objects.create(organization=org, email=form_step2.cleaned_data['email'], **form_contact_info.cleaned_data)
                org_payment = OrganizationPaymentInfo.objects.create(organization=org, **form_payment.cleaned_data)
                org_contact.save()
                org_payment.save()
                website.save()
                
                user_form_cleaned = form_step2.cleaned_data
                del user_form_cleaned['password2']
                u = User.objects.create(**user_form_cleaned)
                up = UserProfile.objects.create(user=u)
                up.organizations.add(org)

            
            for up in UserProfile.objects.filter(admin_level=ADMINLEVEL_ADMINISTRATOR):
                up.admin_assigned_organizations.add(org)
                up.save()
            return HttpResponseRedirect("/network/publisher/settings/")
    else:
        if oid:
            org = Organization.objects.get(pk=oid)
            org_contact = OrganizationContacts.objects.get(organization=org)
            org_payment_info = OrganizationPaymentInfo.objects.get(organization=org)
            website = Website.objects.get(publisher=org, is_default = True)
            up = UserProfile.objects.filter(organizations=org).select_related("user")[0]
            
            form_step2 = PublisherSignupForm2(True, initial={'first_name':up.user.first_name, 'last_name':up.user.last_name, 'email':up.user.email, })
            form_step3 = PublisherSignupForm3(True, initial={'company_name':org.company_name,'pub_address':org.address,'pub_address2':org.address2, 'pub_city':org.city,
                                                'pub_state':org.state,'pub_zipcode':org.zipcode, 'pub_country':org.country, 'pub_province':org.state})
            form_payment = PaymentInfoForm(instance=org_payment_info)
            form_contact_info = ContactInfoForm(instance=org_contact)
            website_form = WebsiteForm(instance=website)
        else:
            form_step2 = PublisherSignupForm2()
            form_step3 = PublisherSignupForm3()
            form_payment = PaymentInfoForm()
            form_contact_info = ContactInfoForm()
            website_form = WebsiteForm(organization=request.organization)
        
    return AQ_render_to_response(request, 'network/publisher/create.html', {
            'form_step2':form_step2,
            'form_step3':form_step3,
            'form_payment':form_payment,
            'website_form':website_form,
            'form_contact_info':form_contact_info,
        }, context_instance=RequestContext(request))