Admin-media symlinking sometimes fail under virtualenv. Catching the error and giving a warning instead.

This commit is contained in:
Griatch 2012-04-01 19:07:34 +02:00
parent 00c4f8a60d
commit ad63abee39

View file

@ -174,8 +174,11 @@ def create_admin_media_links():
os.mkdir(apath)
os.system('xcopy "%s" "%s" /e /q /c' % (dpath, apath))
if os.name == 'posix':
os.symlink(dpath, apath)
print _(" Admin-media symlinked to ADMIN_MEDIA_ROOT.")
try:
os.symlink(dpath, apath)
print _(" Admin-media symlinked to ADMIN_MEDIA_ROOT.")
except OSError:
print _(" There was an error symlinking Admin-media to ADMIN_MEDIA_ROOT. If you see issues, link manually.")
else:
print _(" Admin-media files should be copied manually to ADMIN_MEDIA_ROOT.")