Skip to content

Commit

Permalink
fix: self serve track creation optional params (#4823)
Browse files Browse the repository at this point in the history
* fix: optional parameters

* fix: remove unnecessary/broken state
  • Loading branch information
M7mdisk authored Aug 28, 2024
1 parent 4fc3e3f commit 81069dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions static/js/publisher/release/components/releasesHeading.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function ReleasesHeading(props) {
const [trackGuardrailsStatus, setTrackGuardrailsStatus] = useState(null);
const [guardrailsLoading, setGuardrailsLoading] = useState(true);

const [isTrackNameFilled, setIsTrackNameFilled] = useState(false);
const isTrackNameFilled = trackName.trim().length > 0;
const [isLoading, setIsLoading] = useState(false);
const [notification, setNotification] = useState(null);

Expand Down Expand Up @@ -134,7 +134,6 @@ function ReleasesHeading(props) {
setTrackNameError("");
const { value } = event.target;
setTrackName(value);
setIsTrackNameFilled(value.trim().length > 0);
};

const handleVersionPatternChange = (event) => {
Expand Down
8 changes: 4 additions & 4 deletions webapp/store/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,12 +414,12 @@ def sitemap():
@exchange_required
def post_create_track(snap_name):
track_name = flask.request.form["track-name"]
version_pattern = flask.request.form["version-pattern"]
auto_phasing_percentage = flask.request.form[
version_pattern = flask.request.form.get("version-pattern")
auto_phasing_percentage = flask.request.form.get(
"automatic-phasing-percentage"
]
)

if auto_phasing_percentage:
if auto_phasing_percentage is not None:
auto_phasing_percentage = float(auto_phasing_percentage)

response = publisher_api.create_track(
Expand Down

0 comments on commit 81069dd

Please sign in to comment.