+editpgpkeys can have an action that is not a string

Bug #520476 reported by Curtis Hovey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Brad Crittenden

Bug Description

OOPS-1502N4471 shows that getattr(self, action) was called and the action was not a string, it is None.

PersonGPGView.form_action looks like:
    def form_action(self):
        permitted_actions = ['claim_gpg', 'deactivate_gpg',
                             'remove_gpgtoken', 'reactivate_gpg']
        if self.request.method != "POST":
            return ''
        action = self.request.form.get('action')
        if action and (action not in permitted_actions):
            raise UnexpectedFormData("Action was not defined")
        getattr(self, action)()

I cannot see how this happened, but for the view to work as we intend, it should do:
        if action not in permitted_actions:
            raise UnexpectedFormData("Action was not defined")

Related branches

Curtis Hovey (sinzui)
Changed in launchpad-registry:
milestone: none → series-10.05
Brad Crittenden (bac)
Changed in launchpad-registry:
status: Triaged → In Progress
assignee: nobody → Brad Crittenden (bac)
Curtis Hovey (sinzui)
Changed in launchpad-registry:
milestone: series-future → 10.05
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: In Progress → Fix Committed
Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
tags: added: qa-needstesting
Curtis Hovey (sinzui)
tags: added: qa-ok
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in launchpad-registry:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.