def on_view_server(self, data): from backend.tasks import read_public_key try: data['pubkey'] = read_public_key.delay(data['instance'].environment_id).get() except Exception as e: data['pubkey'] = 'Couldn\'t load' return data
def on_view(self): from backend.tasks import read_public_key try: self.data['pubkey'] = read_public_key.delay(self.form.instance.environment_id).get() except Exception as e: self.data['pubkey'] = 'Couldn\'t load' if not self.is_new: self.form.fields['password'].help_text = "Leave blank if not changing"
def on_view_server(self, data): from backend.tasks import read_public_key try: data['pubkey'] = read_public_key.delay( data['instance'].environment_id).get() except Exception as e: data['pubkey'] = 'Couldn\'t load' return data
def on_view_server(self, data): from backend.tasks import read_public_key try: data["pubkey"] = read_public_key.delay(data["instance"].environment_id).get() except Exception as e: data["pubkey"] = "Couldn't load" return data
def on_view_server(self): from backend.tasks import read_public_key try: self.data['pubkey'] = read_public_key.delay(self.form.instance.environment_id).get() except Exception as e: self.data['pubkey'] = 'Couldn\'t load'
def on_view_server(self, data): from backend.tasks import read_public_key data['pubkey'] = read_public_key.delay(data['instance'].environment_id).get() return data