On Friday, September 8, 2017 at 8:32:08 PM UTC+5:30, Keegan Patrao wrote:
>
> Hello All,
>
> I added custom fields as specified in the Docs. 
> http://mezzanine.jupo.org/docs/user-accounts.html
> However I used unique=True on one field. When the form is filled by the 
> user incase of a unique constraint. Mezzanine does not show the form again 
> with the filled in fields but ends up creating the user with the fields 
> blank and throws up and error for the user.
>
> Custom Model Used.
> =====================
>
>
> REGION_CHOICES=(('USA','USA'),('GULF','GULF'),('ASIA','ASIA'),('EUROPE','EUROPE'),)
>
> CURRENCY_CHOICES=(('USD','US DOLLARS'),('INR','INDIAN 
> RUPEES'),('AED','DIRHAMS'),)
>
>
> SALES_PARTNER_CHOICES=(('SALESPARTNER','SALESPARTNER'),('INDIVIDUAL','INDIVIDUAL'))
>
>
> class MyProfile(models.Model):
>
> user=models.OneToOneField("auth.User")
>
> company_name=models.CharField("Company Name",max_length=200,unique=True)
>
> phone_no=models.CharField("Contact No",max_length=200, help_text="Include 
> country code   00-91-PhoneNo")
>
> sales_partner=models.CharField("Sales Partner or 
> Individual",max_length=200,choices=SALES_PARTNER_CHOICES,help_text="Select 
> Sales Partner, only  if your intrested in  becoming a  Sales partner")
>
> region=models.CharField("Select Region", 
> max_length=200,choices=REGION_CHOICES,help_text="Select your Region")
>
>
>
> Error message received :
>
> http://dpaste.com/1A3M14E
>
>
> Kindly advise how to go about this ? 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mezzanine Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to