minor changes in ticket_storage
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 1.99.4 (2012-02-27 16:57:41) stable
|
Version 1.99.4 (2012-02-28 10:08:51) stable
|
||||||
|
|||||||
@@ -1173,14 +1173,15 @@ def errors():
|
|||||||
|
|
||||||
def get_ticket_storage(app):
|
def get_ticket_storage(app):
|
||||||
private_folder = apath('%s/private' % app, r=request)
|
private_folder = apath('%s/private' % app, r=request)
|
||||||
try:
|
ticket_file = os.path.join(private_folder, 'ticket_storage.txt')
|
||||||
db_string = open(os.path.join(private_folder, 'ticket_storage.txt')).read().replace('\r','').replace('\n','').strip()
|
if os.path.exists(ticket__file):
|
||||||
except IOError:
|
db_string = open(ticket_file).read()
|
||||||
|
db_string = db_string.strip().replace('\r','').replace('\n','')
|
||||||
|
else:
|
||||||
raise Exception, "No ticket_storage.txt found in /private folder"
|
raise Exception, "No ticket_storage.txt found in /private folder"
|
||||||
tickets_table = 'web2py_ticket'
|
tickets_table = 'web2py_ticket'
|
||||||
tablename = tickets_table + '_' + app
|
tablename = tickets_table + '_' + app
|
||||||
db_path = apath('%s/databases' % app, r=request)
|
db_path = apath('%s/databases' % app, r=request)
|
||||||
from gluon import DAL
|
|
||||||
ticketsdb = DAL(db_string, folder=db_path, auto_import=True)
|
ticketsdb = DAL(db_string, folder=db_path, auto_import=True)
|
||||||
if not ticketsdb.get(tablename):
|
if not ticketsdb.get(tablename):
|
||||||
table = ticketsdb.define_table(
|
table = ticketsdb.define_table(
|
||||||
|
|||||||
Reference in New Issue
Block a user