admin.py 937 Bytes
Newer Older
Marc Duez's avatar
Marc Duez committed
1 2 3 4 5 6 7 8 9 10
# coding: utf8
import gluon.contrib.simplejson
if request.env.http_origin:
    response.headers['Access-Control-Allow-Origin'] = request.env.http_origin  
    response.headers['Access-Control-Allow-Credentials'] = 'true'
    response.headers['Access-Control-Max-Age'] = 86400
    

## return admin_panel
def index():
11 12
    if auth.has_membership("admin"):
        return dict(message=T(''))
Marc Duez's avatar
Marc Duez committed
13 14 15


def result():
16 17
    if auth.has_membership("admin"):
        return dict(message=T(''))
Marc Duez's avatar
Marc Duez committed
18 19

def run_all():
20 21 22 23 24 25 26 27 28 29 30 31
    if auth.has_membership("admin"):
        query = db(
                (db.data_file.sequence_file_id==db.sequence_file.id)
                & (db.data_file.config_id==db.config.id)
            ).select()

        for row in query:
            schedule_run(row.sequence_file.id, row.config.id)

        res = {"success" : "true",
               "message" : "rerun all"}
        return gluon.contrib.simplejson.dumps(res, separators=(',',':'))