#405 create-review: ensure optional keys are initialized in Settings
Merged 3 years ago by ngompa. Opened 3 years ago by dcavalca.
dcavalca/FedoraReview cr-fix-settings  into  master

@@ -133,6 +133,9 @@ 

  

      # upload target

      upload_target = "@username@.fedorapeople.org:public_html/"

+     # bugzilla settings

+     bugzilla_api_key = ""

+     bugzilla_username = ""

  

      def __init__(self):

          """Constructor of the Settings object.
@@ -140,8 +143,8 @@ 

          attributes the default configuration with each available option.

          """

          self._dict = {

-             "bugzilla_api_key": "",

-             "bugzilla_username": "",

+             "bugzilla_api_key": self.bugzilla_api_key,

+             "bugzilla_username": self.bugzilla_username,

              "upload_target": self.upload_target,

          }

          self.load_config(SETTINGS_FILE, "fedora-create-review")

These fields are optional, so ensure they're always initialized to something sane. This should fix #404

Pull-Request has been merged by ngompa

3 years ago
Metadata