add working redirect after device add completes

This commit is contained in:
Jakob Ketterl 2021-03-03 15:30:33 +01:00
parent c0b7cf5f8d
commit fdbb76bca1
2 changed files with 7 additions and 1 deletions

View File

@ -78,10 +78,13 @@ class SettingsFormController(AuthorizationMixin, WebpageController, metaclass=AB
data = parse_qs(self.get_body().decode("utf-8"), keep_blank_values=True)
return {k: v for i in self.getSections() for k, v in i.parse(data).items()}
def getSuccessfulRedirect(self):
return self.request.path
def processFormData(self):
self.processData(self.parseFormData())
self.store()
self.send_redirect(self.request.path)
self.send_redirect(self.getSuccessfulRedirect())
def processData(self, data):
config = self.getData()

View File

@ -197,6 +197,9 @@ class NewSdrDeviceController(SettingsFormController):
config["sdrs"] = sdrs
super().store()
def getSuccessfulRedirect(self):
return "{}settings/sdr/{}".format(self.get_document_root(), self.stack["id"])
class SdrProfileController(SdrFormController):
def __init__(self, handler, request, options):