Switch to unified view

a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
...
...
140
        form_data['neighborhood'] = self.neighborhood.name
140
        form_data['neighborhood'] = self.neighborhood.name
141
        return dict(neighborhood=self.neighborhood, form_data=form_data)
141
        return dict(neighborhood=self.neighborhood, form_data=form_data)
142
142
143
    @h.vardec
143
    @h.vardec
144
    @expose()
144
    @expose()
145
    @require_post
145
    @require_post()
146
    @validate(W.add_project, error_handler=add_project)
146
    @validate(W.add_project, error_handler=add_project)
147
    def register(self, project_unixname=None, project_description=None, project_name=None, neighborhood=None, **kw):
147
    def register(self, project_unixname=None, project_description=None, project_name=None, neighborhood=None, **kw):
148
        require(has_neighborhood_access('create', self.neighborhood), 'Create access required')
148
        require(has_neighborhood_access('create', self.neighborhood), 'Create access required')
149
        project_description = h.really_unicode(project_description or '').encode('utf-8')
149
        project_description = h.really_unicode(project_description or '').encode('utf-8')
150
        project_name = h.really_unicode(project_name or '').encode('utf-8')
150
        project_name = h.really_unicode(project_name or '').encode('utf-8')
...
...
531
    def _lookup(self, short, *remainder):
531
    def _lookup(self, short, *remainder):
532
        short=unquote(short)
532
        short=unquote(short)
533
        return AwardController(short), remainder
533
        return AwardController(short), remainder
534
534
535
    @expose()
535
    @expose()
536
    @require_post
536
    @require_post()
537
    def create(self, icon=None, short=None, full=None):
537
    def create(self, icon=None, short=None, full=None):
538
        app_config_id = ObjectId()
538
        app_config_id = ObjectId()
539
        tool_version = { 'neighborhood':'0' }
539
        tool_version = { 'neighborhood':'0' }
540
        if short is not None:
540
        if short is not None:
541
            award = M.Award(app_config_id=app_config_id, tool_version=tool_version)
541
            award = M.Award(app_config_id=app_config_id, tool_version=tool_version)
...
...
547
                square=True, thumbnail_size=(48,48),
547
                square=True, thumbnail_size=(48,48),
548
                thumbnail_meta=dict(award_id=award._id))
548
                thumbnail_meta=dict(award_id=award._id))
549
        redirect(request.referer)
549
        redirect(request.referer)
550
550
551
    @expose()
551
    @expose()
552
    @require_post
552
    @require_post()
553
    def grant(self, grant=None, recipient=None):
553
    def grant(self, grant=None, recipient=None):
554
        grant_q = M.Award.query.find(dict(short=grant)).first()
554
        grant_q = M.Award.query.find(dict(short=grant)).first()
555
        recipient_q = M.Project.query.find(dict(name=recipient, deleted=False)).first()
555
        recipient_q = M.Project.query.find(dict(name=recipient, deleted=False)).first()
556
        app_config_id = ObjectId()
556
        app_config_id = ObjectId()
557
        tool_version = { 'neighborhood':'0' }
557
        tool_version = { 'neighborhood':'0' }
...
...
591
        if not icon:
591
        if not icon:
592
            raise exc.HTTPNotFound
592
            raise exc.HTTPNotFound
593
        return icon.serve()
593
        return icon.serve()
594
594
595
    @expose()
595
    @expose()
596
    @require_post
596
    @require_post()
597
    def grant(self, recipient=None):
597
    def grant(self, recipient=None):
598
        recipient_q = M.Project.query.find(dict(name=recipient, deleted=False)).first()
598
        recipient_q = M.Project.query.find(dict(name=recipient, deleted=False)).first()
599
        app_config_id = ObjectId()
599
        app_config_id = ObjectId()
600
        tool_version = { 'neighborhood':'0' }
600
        tool_version = { 'neighborhood':'0' }
601
        grant = M.AwardGrant(app_config_id=app_config_id, tool_version=tool_version)
601
        grant = M.AwardGrant(app_config_id=app_config_id, tool_version=tool_version)