Esempio n. 1
0
    def post(self):
        url = self.request.get('url')
        if url and len(url):
            deferred = self.request.get('deferred')
            key = page.create(url)
            if not deferred:
                url = page.resolve(url)
                if url:
                    page.store(key, url)
            else:
                taskqueue.add(url='/deferred', params=dict(url=url, key=key))

            if key and url:
                self.response.set_status(201)
                self.response.headers['Location'] = '%s/%s' % (self.request.host_url, key)
                self.response.clear()
            else:
                self.response.set_status(404)
        else:
            self.response.set_status(400)
Esempio n. 2
0
File: norm.py Progetto: alkadis/vcv
def create(check, variant=Text.HEAD):
    check.valid_email()
    page.create(check)
    check.other('instance_without_norms', not c.instance.use_norms)
    check.other('instance_frozen', c.instance.frozen)
Esempio n. 3
0
def create(variant=Text.HEAD):
    return has('instance.admin') and page.create() and \
            c.instance.use_norms and not c.instance.frozen
Esempio n. 4
0
def create(variant=Text.HEAD):
    return has('instance.admin') and page.create() and \
            c.instance.use_norms and not c.instance.frozen