1. David Chambers
  2. Mango

Commits

Chris Chambers  committed 15d593c

Added support for '~' usage in PATH_TO_POSTS and STATIC and ensured no trailing slashes in the settings files

  • Participants
  • Parent commits 6b4a07e
  • Branches default

Comments (0)

Files changed (3)

File settings/__init__.py

View file
     execfile(os.path.join(dirname, 'custom.py'))
 except IOError:
     pass
+
+BASE_URL = BASE_URL.rstrip('/')
+PATH_TO_POSTS = os.path.expanduser(PATH_TO_POSTS.rstrip('/'))
+PATH_TO_STATIC = os.path.expanduser(PATH_TO_STATIC.rstrip('/'))

File utils.py

View file
             fragments.insert(1, tail)
             head, tail = os.path.split(head)
         path_to_posts = u'/'.join(fragments)
-    return path_to_posts.rstrip(u'/') #The rstrip allows the user to specify it with or without a trailing slash
+    return path_to_posts
 
 def post_urls(filepath):
     """

File views.py

View file
                                 convert_html_chars(message))
                         for action, messages in sorted(MESSAGES.items()):
                             text_content += u'\n\n* %s: %s/moderate/%s?%s' % (
-                                    messages['do'], BASE_URL.rstrip('/'), action, query_string)
+                                    messages['do'], BASE_URL, action, query_string)
                             html_content += u'<li><a href="%s/moderate/%s?%s">%s</a></li>' % (
-                                    BASE_URL.rstrip('/'), action, convert_html_chars(query_string), messages['do'])
-                        text_content += u'\n\n* Respond: %s/%s/#respond' % (BASE_URL.rstrip('/'), path)
-                        html_content += u'<li><a href="%s/%s/#respond">Respond</a></li></ul>' % (BASE_URL.rstrip('/'), path)
+                                    BASE_URL, action, convert_html_chars(query_string), messages['do'])
+                        text_content += u'\n\n* Respond: %s/%s/#respond' % (BASE_URL, path)
+                        html_content += u'<li><a href="%s/%s/#respond">Respond</a></li></ul>' % (BASE_URL, path)
 
                         msg = EmailMultiAlternatives(subject, text_content, author, [utils.primary_author_email()])
                         msg.attach_alternative(html_content, 'text/html')