code: def accept(self):
          
          enable_busy_cursor()
          self.button_box.setEnabled(False)
          layer = layer_from_combo(self.layers)
  
          login = self.login.text()
          if self.save_login.isChecked():
              set_setting(GEONODE_USER, login)
          else:
              set_setting(GEONODE_USER, '')
  
          password = self.password.text()
          if self.save_password.isChecked():
              set_setting(GEONODE_PASSWORD, password)
          else:
              set_setting(GEONODE_PASSWORD, '')
  
          url = self.url.text()
          if self.save_url.isChecked():
              set_setting(GEONODE_URL, url)
          else:
              set_setting(GEONODE_URL, '')
  
          geonode_session = login_user(url, login, password)
  
          try:
              result = upload(url, geonode_session, layer.source())
          except GeoNodeLayerUploadError as e:
              result = {
                  'success': False,
                  'message': str(e)
              }
          finally:
              self.button_box.setEnabled(True)
              disable_busy_cursor()
  
          if result['success']:
              self.done(QDialog.Accepted)
              layer_url = urljoin(url, result['url'])
              # Link is not working in QGIS 2.
              # It's gonna work in QGIS 3.
              if qgis_version() >= 29900:
                  external_link = '<a href=\"{url}\">{url}</a>'.format(
                      url=layer_url)
              else:
                  external_link = layer_url
  
              display_success_message_bar(
                  tr('Uploading done'),
                  tr('Successfully uploaded to {external_link}').format(
                      external_link=external_link),
              )
          else:
              display_warning_message_box(
                  self,
                  tr('Error while uploading the layer.'),
                  str(result)
              )
docs: Upload the layer to Geonode.