fix(onion): correct some form fields
This commit is contained in:
parent
c584aa0e90
commit
540fa12a3b
1 changed files with 3 additions and 2 deletions
|
@ -34,13 +34,13 @@ class NewOnionForm(FlaskForm): # type: ignore
|
|||
|
||||
|
||||
class EditOnionForm(FlaskForm): # type: ignore
|
||||
description = StringField('Description', validators=[DataRequired()])
|
||||
group = SelectField('Group', validators=[DataRequired()])
|
||||
domain_name = StringField('Domain Name', validators=[DataRequired()])
|
||||
description = StringField('Description', validators=[DataRequired()])
|
||||
tls_private_key = FileField('TLS Private Key (PEM format)',
|
||||
description="If no file is submitted, the TLS key will remain unchanged.")
|
||||
tls_public_key = FileField('TLS Certificate (PEM format)',
|
||||
description="If no file is submitted, the TLS certificate will remain unchanged.")
|
||||
group = SelectField('Group', validators=[DataRequired()])
|
||||
submit = SubmitField('Save Changes')
|
||||
|
||||
|
||||
|
@ -89,6 +89,7 @@ def onion_edit(onion_id: int) -> ResponseReturnValue:
|
|||
message="The requested onion service could not be found."),
|
||||
status=404)
|
||||
form = EditOnionForm(group=onion.group_id,
|
||||
domain_name=onion.domain_name,
|
||||
description=onion.description)
|
||||
form.group.choices = [(x.id, x.group_name) for x in Group.query.all()]
|
||||
if form.validate_on_submit():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue