Opened 8 years ago

Closed 7 years ago

#4639 closed (duplicate)

unique_together and edit_inline, IntegrityError instead of suitable error message

Reported by: Reza Mohammadi <reza@…> Owned by: adrian
Component: contrib.admin Version: 0.96
Severity: Keywords:
Cc: jshaffer2112@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

models:

class TranslatableString(models.Model):
    title = models.CharField(_('Title'), maxlength=200)
    class Admin:
        pass
        
class TranslationString(models.Model):
    main = models.ForeignKey(TranslatableString,verbose_name=_("Translation of string"),
                             edit_inline=models.STACKED)
    lang = models.ForeignKey(Language, core=True)
    translation = models.CharField(_('Translation'), maxlength=200)
    ...

I'm adding/editing TranslatableString, and when I enter two TranslationStrings with same lang,
I see this server error:

IntegrityError at /admin/i18n/translatablestring/1/

columns main_id, lang_id are not unique

But I excepted some suitable error message in red!

Change History (3)

comment:1 Changed 8 years ago by John Shaffer <jshaffer2112@…>

  • Cc jshaffer2112@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 8 years ago by Simon G. <dev@…>

Duplicate of #565

comment:3 Changed 7 years ago by Brian Rosner <brosner@…>

  • Resolution set to duplicate
  • Status changed from new to closed

Simon, I believe you meant to close this. I am closing it now.

Note: See TracTickets for help on using tickets.
Back to Top