示例#1
0
 def _parse_user(self, values, conn):
     account_apikey = values.get('user')
     if not account_apikey:
         raise errors.MissingParameterError('user')
     self.account_id = lookup_account_id_by_apikey(conn, account_apikey)
     if not self.account_id:
         raise errors.InvalidUserAPIKeyError()
示例#2
0
 def _parse_user(self, values, db):
     # type: (MultiDict, DatabaseContext) -> None
     account_apikey = values.get('user')
     if not account_apikey:
         raise errors.MissingParameterError('user')
     self.account_id = check_user_api_key(self.config, db, account_apikey)
     if not self.account_id:
         raise errors.InvalidUserAPIKeyError()
示例#3
0
 def _parse_user(self, values, db):
     # type: (MultiDict, DatabaseContext) -> None
     account_apikey = values.get('user')
     if not account_apikey:
         raise errors.MissingParameterError('user')
     self.account_id = lookup_account_id_by_apikey(db.get_app_db(),
                                                   account_apikey)
     if not self.account_id:
         raise errors.InvalidUserAPIKeyError()
示例#4
0
 def parse(self, values, conn):
     super(UserLookupHandlerParams, self).parse(values, conn)
     account_apikey = values.get('user')
     if not account_apikey:
         raise errors.MissingParameterError('user')
     self.account_id = lookup_account_id_by_apikey(conn, account_apikey)
     if not self.account_id:
         raise errors.InvalidUserAPIKeyError()
     self.account_apikey = account_apikey