Exemplo 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)
Exemplo n.º 2
0
Arquivo: norm.py Projeto: 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)
Exemplo 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
Exemplo 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