Opened 17 years ago

Closed 17 years ago

#4639 closed (duplicate)

unique_together and edit_inline, IntegrityError instead of suitable error message

Reported by: Reza Mohammadi <reza@…> Owned by: Adrian Holovaty
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: no UI/UX: no

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 by John Shaffer <jshaffer2112@…>, 17 years ago

Cc: jshaffer2112@… added

comment:2 by Simon G. <dev@…>, 17 years ago

Duplicate of #565

comment:3 by Brian Rosner <brosner@…>, 17 years ago

Resolution: duplicate
Status: newclosed

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

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