Merge pull request #1867 from bagerard/pmatos_patch-1

Doc update: Clarify comment in validation example
This commit is contained in:
erdenezul 2018-09-03 07:42:39 +08:00 committed by GitHub
commit bfe5b03c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,8 @@ document values for example::
def clean(self): def clean(self):
"""Ensures that only published essays have a `pub_date` and """Ensures that only published essays have a `pub_date` and
automatically sets the pub_date if published and not set""" automatically sets `pub_date` if essay is published and `pub_date`
is not set"""
if self.status == 'Draft' and self.pub_date is not None: if self.status == 'Draft' and self.pub_date is not None:
msg = 'Draft entries should not have a publication date.' msg = 'Draft entries should not have a publication date.'
raise ValidationError(msg) raise ValidationError(msg)