[Webkit-unassigned] [Bug 29307] commit-queue needs web-based status reporting

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 17 18:13:45 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=29307





--- Comment #3 from Evan Martin <evan at chromium.org>  2009-09-17 18:13:45 PDT ---
(From update of attachment 39740)
> +    <div id="current_status">
> +        {{ last_status.message|escape|webkit_linkify }}
> +        <div id="last_status_date">As of {{ last_status.date|timesince }} ago</div>
> +    </div>

Djangos since 1.0 autoescape {{}} bits; you only get the old one on appengine
by default
for backwards compat.

from google.appengine.dist import use_library
use_library('django', '1.1')

> +class QueueStatus(db.Model):
> +    author = db.UserProperty()
> +    active_bug_id = db.IntegerProperty()
> +    active_patch_id = db.IntegerProperty()
> +    message = db.StringProperty(multiline=True)

Maybe db.Text() is better for this?

> +    date = db.DateTimeProperty(auto_now_add=True)

> +        path = os.path.join(os.path.dirname(__file__), 'index.html')
> +        self.response.out.write(template.render(path, template_values))

Consider factoring this repeated bit into a helper function.

> +    def post(self):
> +        queue_status = QueueStatus()
> +
> +        if users.get_current_user():
> +            queue_status.author = users.get_current_user()
> +
> +        queue_status.active_bug_id = self._int_from_request('bug_id')
> +        queue_status.active_patch_id = self._int_from_request('patch_id')
> +        queue_status.message = self.request.get('status')
> +        queue_status.put()
> +        self.redirect('/')

I guess this is XSRFable.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list