Skip to content

Commit

Permalink
Fixed #8777: use better capitalization in unique together error messa…
Browse files Browse the repository at this point in the history
…ge. Thanks, Petr Marhoun.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8820 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed Sep 1, 2008
1 parent 3a18002 commit d86a702
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions django/forms/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from django.utils.encoding import smart_unicode
from django.utils.datastructures import SortedDict
from django.utils.text import get_text_list
from django.utils.text import get_text_list, capfirst
from django.utils.translation import ugettext_lazy as _

from util import ValidationError, ErrorList
Expand Down Expand Up @@ -247,7 +247,7 @@ def validate_unique(self):
# This cute trick with extra/values is the most efficiant way to
# tell if a particular query returns any results.
if qs.extra(select={'a': 1}).values('a').order_by():
model_name = self.instance._meta.verbose_name.title()
model_name = capfirst(self.instance._meta.verbose_name)

# A unique field
if len(unique_check) == 1:
Expand Down

0 comments on commit d86a702

Please sign in to comment.