deis / controller

Deis Workflow Controller (API)
https://deis.com
MIT License
41 stars 53 forks source link

Key with this public already exists. #849

Closed Joshua-Anderson closed 8 years ago

Joshua-Anderson commented 8 years ago

The error message for adding a key that already exists is odd.

{
    "public": ["Key with this public already exists."]
}
bacongobbler commented 8 years ago

That's how django rest framework renders errors. A field can fail multiple validations, so it returns an array which contains each validation error that failed for that field.

Joshua-Anderson commented 8 years ago

@bacongobbler It's not the format... it's the auto-generated validation error message: Key with this public already exists.

helgi commented 8 years ago

Those we can customise - Just needs to be done in the Model schema definition. We should probably take a look at all the definitions and change accordingly.

By default DRF / Django will do a {ModelName} bla bla {fieldname} bla bla where {ModelName} will have s appended if it is a plural. Somewhat out own fault for naming things the way we did as sometimes it doesn't lend it self to nice auto-generated messages :)