kewisch/pyamo

amo info produces a cryptic error for own add-ons

palant opened this issue · 0 comments

AMO won't allow you to open reviews for your own add-ons, redirecting to queues page instead. Because of that, amo info adblock-plus will produce the following error for me:

Traceback (most recent call last):
File "amo", line 9, in
load_entry_point('pyamo==1.0.0', 'console_scripts', 'amo')()
File "pyamo/cli.py", line 265, in main
handler.run(sys.argv[1:], context_fxn=load_context)
File "arghandler/base.py", line 245, in run
self._subcommand_lookupargs.cmd
File "pyamo/cli.py", line 51, in cmd_info
review = amo.get_review(args.addon)
File "pyamo/service.py", line 36, in get_review
review.get()
File "pyamo/review.py", line 44, in get
self.token = doc.xpath(csspath('form input[name="csrfmiddlewaretoken"]'))[0].attrib['value']
IndexError: list index out of range

This is rather cryptic - "self-reviews" should rather be recognized and a corresponding message should be produced. For reference, the page has the following message:

    <div class="notification-box warning">
      <h2>
          Self-reviews are not allowed.
      </h2>
    </div>