Opened 5 years ago

Closed 5 years ago

#13225 closed (duplicate)

new object with readonly m2m field through an error in the admin

Reported by: benc Owned by: nobody
Component: contrib.admin Version: 1.2-beta
Severity: Keywords: admin, readonly_fields, m2m
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I have a model with m2m field that I want to be readonly.

I want the admin user to be able to see this field but not edit it and I'll populate it in the model save method.

When trying to create a new model instance I'm getting:

instance needs to have a primary key value before a many-to-many relationship can be used.

It should be able to just put an empty string or None in the readonly field.

Thanks

Change History (1)

comment:1 Changed 5 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to duplicate
  • Status changed from new to closed

This is a dupe of #13004.

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