예제 #1
0
파일: idea.py 프로젝트: etboggs/inphosite
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)

        idea = h.fetch_obj(Idea, id, new_id=True)
        terms = ['sep_dir'] 

        h.update_obj(idea, terms, request.params)

        return self.view(id)
예제 #2
0
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)

        idea = h.fetch_obj(Idea, id, new_id=True)
        terms = ['sep_dir'] 

        h.update_obj(idea, terms, request.params)

        return self.view(id)
예제 #3
0
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)
        if not h.auth.is_admin():
            abort(403)

        journal = h.fetch_obj(Journal, id)
        terms = ['openAccess', 'URL', 'ISSN', 'noesisInclude', 'student', 'active']

        h.update_obj(journal, terms, request.params)

        return self.view(id)
예제 #4
0
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)
        if not h.auth.is_admin():
            abort(403)

        school_of_thought = h.fetch_obj(SchoolOfThought, id)
        terms = ['sep_dir']

        h.update_obj(school_of_thought, terms, request.params)

        return self.view(id)
예제 #5
0
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)
        if not h.auth.is_admin():
            abort(403)

        thinker = h.fetch_obj(Thinker, id)
        terms = ['sep_dir', 'wiki']

        h.update_obj(thinker, terms, request.params)

        return self.view(id)
예제 #6
0
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)
        if not h.auth.is_admin():
            abort(403)

        thinker = h.fetch_obj(Thinker, id)
        terms = ['sep_dir', 'wiki'] 

        h.update_obj(thinker, terms, request.params)

        return self.view(id)
예제 #7
0
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)
        if not h.auth.is_admin():
            abort(403)

        work = h.fetch_obj(model.Work, id)
        terms = ['sep_dir'] 

        h.update_obj(work, terms, request.params)

        return self.view(id)
예제 #8
0
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)
        if not h.auth.is_admin():
            abort(403)

        school_of_thought = h.fetch_obj(SchoolOfThought, id)
        terms = ['sep_dir'] 

        h.update_obj(school_of_thought, terms, request.params)

        return self.view(id)
예제 #9
0
    def update(self, id=None):
        if not h.auth.is_logged_in():
            abort(401)
        if not h.auth.is_admin():
            abort(403)

        journal = h.fetch_obj(Journal, id)
        terms = [
            'openAccess', 'URL', 'ISSN', 'noesisInclude', 'student', 'active'
        ]

        h.update_obj(journal, terms, request.params)

        return self.view(id)
예제 #10
0
파일: entity.py 프로젝트: inpho/inphosite
    def update(self, id, terms=None):
        if not h.auth.is_logged_in():
            response.status_int = 401
            return "Unauthorized"
        if not h.auth.is_admin():
            response.status_int = 403
            return "Forbidden"

        # if no whitelist is passed in, go with default
        if terms is None:
            terms = ["sep_dir", "searchstring", "label"]

        entity = h.fetch_obj(self._type, id)
        h.update_obj(entity, terms, request.params)

        # Check for redirect
        if request.params.get("redirect", False):
            h.redirect(h.url(controller=self._controller, action="view", id=entity.ID))
        else:
            # Issue an HTTP success
            response.status_int = 200
            return "OK"
예제 #11
0
    def update(self, id, terms=None):
        if not h.auth.is_logged_in():
            response.status_int = 401
            return "Unauthorized"
        if not h.auth.is_admin():
            response.status_int = 403
            return "Forbidden"

        #if no whitelist is passed in, go with default
        if terms is None:
            terms = ['sep_dir', 'searchstring', 'label']

        entity = h.fetch_obj(self._type, id)
        h.update_obj(entity, terms, request.params)

        # Check for redirect
        if request.params.get('redirect', False):
            h.redirect(
                h.url(controller=self._controller, action='view', id=entity.ID))
        else:
            # Issue an HTTP success
            response.status_int = 200
            return "OK"