Factored out hardcoded support email address from various places.
Now it's configurable in the common settings.
This commit is contained in:
parent
082697fe5a
commit
824882a1d8
|
@ -19,5 +19,6 @@ settings = {
|
|||
"luminotes.https_url": "",
|
||||
"luminotes.http_proxy_ip": "127.0.0.1",
|
||||
"luminotes.https_proxy_ip": "127.0.0.2",
|
||||
"luminotes.support_email": "support@luminotes.com",
|
||||
},
|
||||
}
|
||||
|
|
|
@ -77,13 +77,13 @@ class Root( object ):
|
|||
if status == 404:
|
||||
cherrypy.response.headerMap[ u"Status" ] = u"404 Not Found"
|
||||
cherrypy.response.status = status
|
||||
cherrypy.response.body = [ unicode( Not_found_page() ) ]
|
||||
cherrypy.response.body = [ unicode( Not_found_page( self.__settings[ u"global" ].get( u"luminotes.support_email" ) ) ) ]
|
||||
return
|
||||
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
cherrypy.response.body = [ unicode( Error_page() ) ]
|
||||
cherrypy.response.body = [ unicode( Error_page( self.__settings[ u"global" ].get( u"luminotes.support_email" ) ) ) ]
|
||||
|
||||
scheduler = property( lambda self: self.__scheduler )
|
||||
database = property( lambda self: self.__database )
|
||||
|
|
|
@ -24,7 +24,7 @@ def wait_for_update( function ):
|
|||
try:
|
||||
return queue.get( block = True, timeout = TIMEOUT_SECONDS )
|
||||
except Empty:
|
||||
return { "error": u"A timeout occurred when processing your request. Please try again or contact support@luminotes.com" }
|
||||
return { "error": u"A timeout occurred when processing your request. Please try again or contact support." }
|
||||
|
||||
return get_message
|
||||
|
||||
|
@ -66,7 +66,7 @@ def update_client( function ):
|
|||
result = error.to_dict()
|
||||
queue.put( result )
|
||||
else:
|
||||
queue.put( { "error": u"An error occurred when processing your request. Please try again or contact support@luminotes.com" } )
|
||||
queue.put( { "error": u"An error occurred when processing your request. Please try again or contact support." } )
|
||||
raise
|
||||
|
||||
return put_message
|
||||
|
|
|
@ -99,8 +99,9 @@ def fix_note_contents( contents, notebook_id, note_ids ):
|
|||
|
||||
LINK_PATTERN = re.compile( '(<a href=")([^"]+?note_id=)([^"]*)("[^>]*>)([^<]*)(</a>)' )
|
||||
|
||||
# plug in the notebook id where appropriate
|
||||
# plug in the notebook id and support email address where appropriate
|
||||
contents = contents.replace( "%s", notebook_id )
|
||||
contents = contents.replace( "support@luminotes.com", settings[ u"global" ].get( u"luminotes.support_email", u"" ) )
|
||||
|
||||
# stitch together note links to use the actual note ids of the referenced notes.
|
||||
# also, use the https URL for certain links if one is configured
|
||||
|
|
|
@ -3,7 +3,7 @@ from Tags import Div, H2, P, A, Ul, Li, Strong
|
|||
|
||||
|
||||
class Error_page( Page ):
|
||||
def __init__( self ):
|
||||
def __init__( self, support_email ):
|
||||
title = u"uh oh"
|
||||
|
||||
Page.__init__(
|
||||
|
@ -13,7 +13,7 @@ class Error_page( Page ):
|
|||
H2( title ),
|
||||
P(
|
||||
u"Something went wrong! If you care, please",
|
||||
A( "let us know about it.", href = "mailto:support@luminotes.com" ),
|
||||
A( "let us know about it.", href = "mailto:%s" % support_email ),
|
||||
u"Be sure to include the following information:",
|
||||
),
|
||||
Ul(
|
||||
|
|
|
@ -3,7 +3,7 @@ from Tags import Div, H2, P, A
|
|||
|
||||
|
||||
class Not_found_page( Page ):
|
||||
def __init__( self ):
|
||||
def __init__( self, support_email ):
|
||||
title = u"404"
|
||||
|
||||
Page.__init__(
|
||||
|
@ -13,7 +13,7 @@ class Not_found_page( Page ):
|
|||
H2( title ),
|
||||
P(
|
||||
u"This is not the page you're looking for. If you care, please",
|
||||
A( "let us know about it.", href = "mailto:support@luminotes.com" ),
|
||||
A( "let us know about it.", href = "mailto:%s" % support_email ),
|
||||
),
|
||||
P(
|
||||
u"Thanks!",
|
||||
|
|
Reference in New Issue