diff --git a/app/blueprints/packages/releases.py b/app/blueprints/packages/releases.py index 68a726a0..b06a150f 100644 --- a/app/blueprints/packages/releases.py +++ b/app/blueprints/packages/releases.py @@ -251,7 +251,7 @@ def delete_release(package, id): class PackageUpdateConfigFrom(FlaskForm): trigger = SelectField("Trigger", [InputRequired()], choices=PackageUpdateTrigger.choices(), coerce=PackageUpdateTrigger.coerce, - default=PackageUpdateTrigger.COMMIT) + default=PackageUpdateTrigger.TAG) ref = StringField("Branch name", [Optional()], default=None) action = SelectField("Action", [InputRequired()], choices=[("notification", "Notification"), ("make_release", "Create Release")], default="make_release") submit = SubmitField("Save Settings") @@ -270,8 +270,12 @@ def update_config(package): return redirect(package.getEditURL()) form = PackageUpdateConfigFrom(obj=package.update_config) - if request.method == "GET" and package.update_config: - form.action.data = "make_release" if package.update_config.make_release else "notification" + if request.method == "GET": + if package.update_config: + form.action.data = "make_release" if package.update_config.make_release else "notification" + elif request.args.get("action") == "notification": + form.trigger.data = PackageUpdateTrigger.COMMIT + form.action.data = "notification" if form.validate_on_submit(): if form.disable.data: diff --git a/app/models/packages.py b/app/models/packages.py index f5b4c61a..00591b9c 100644 --- a/app/models/packages.py +++ b/app/models/packages.py @@ -513,9 +513,9 @@ class Package(db.Model): return url_for("packages.bulk_change_release", author=self.author.username, name=self.name) - def getUpdateConfigURL(self): + def getUpdateConfigURL(self, action=None): return url_for("packages.update_config", - author=self.author.username, name=self.name) + author=self.author.username, name=self.name, action=action) def getSetupReleasesURL(self): return url_for("packages.setup_releases", diff --git a/app/templates/packages/release_wizard.html b/app/templates/packages/release_wizard.html index fba321d0..b2875ca5 100644 --- a/app/templates/packages/release_wizard.html +++ b/app/templates/packages/release_wizard.html @@ -24,7 +24,7 @@

Automatically - Manually, enable reminders + Manually, enable reminders Manually, no reminders Later