Skip to content

Commit

Permalink
Use alternative multi-line string syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
codeinthehole committed Jun 28, 2013
1 parent 347b514 commit 13e0769
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions oscar/apps/catalogue/abstract_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,22 +949,23 @@ def __init__(self, name=None):
self.symlink_missing_image(media_file_path)

def symlink_missing_image(self, media_file_path):
# Assume
static_file_path = find('oscar/img/%s' % self.name)
if static_file_path is not None:
try:
os.symlink(static_file_path, media_file_path)
except OSError:
raise ImproperlyConfigured(
"""Please copy/symlink the
"missing image" image at %s into your MEDIA_ROOT at %s.
This exception was raised because Oscar was unable to
symlink it for you."""
% (media_file_path, settings.MEDIA_ROOT))
raise ImproperlyConfigured((
"Please copy/symlink the "
"'missing image' image at %s into your MEDIA_ROOT at %s. "
"This exception was raised because Oscar was unable to "
"symlink it for you.") % (media_file_path,
settings.MEDIA_ROOT))
else:
logging.info(
"""Symlinked the "missing image" image at %s into your
MEDIA_ROOT at %s""" %
(media_file_path, settings.MEDIA_ROOT))
logging.info((
"Symlinked the 'missing image' image at %s into your "
"MEDIA_ROOT at %s") % (media_file_path,
settings.MEDIA_ROOT))


class AbstractProductImage(models.Model):
Expand Down

0 comments on commit 13e0769

Please sign in to comment.