hubgrep.frontend_blueprint.forms.edit_hosting_service module

Form value-object classes and validation functions for editing hosting services.

class hubgrep.frontend_blueprint.forms.edit_hosting_service.HostingServiceFirstStep(*args, **kwargs)

Bases: flask_wtf.form.FlaskForm

Only get type and landingpage from the user, the rest we automatically resolve to pre-fill in step 2.

landingpage_url = <UnboundField(StringField, ('Landingpage Url', [<wtforms.validators.InputRequired object>, <wtforms.validators.URL object>, <function validate_url>]), {'widget': <wtforms.widgets.html5.URLInput object>})>
type = <UnboundField(SelectField, ('Type', [<wtforms.validators.InputRequired object>]), {'choices': [('gitea', 'gitea'), ('gitlab', 'Gitlab'), ('github', 'GitHub')]})>
class hubgrep.frontend_blueprint.forms.edit_hosting_service.HostingServiceForm(*args, **kwargs)

Bases: hubgrep.frontend_blueprint.forms.edit_hosting_service.HostingServiceFirstStep

Final step when adding a new hosting-service, doubling as the form used for editing hosting-services.

api_url = <UnboundField(StringField, ('Api Url', [<wtforms.validators.InputRequired object>, <wtforms.validators.URL object>, <function validate_url>]), {'widget': <wtforms.widgets.html5.URLInput object>})>
config = <UnboundField(TextAreaField, ('Config', [<function validate_config>]), {})>
populate_api_url()
hubgrep.frontend_blueprint.forms.edit_hosting_service.validate_config(form, field)

Validate the config field to adhere to JSON syntax.

hubgrep.frontend_blueprint.forms.edit_hosting_service.validate_url(form, field)