Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncrispify MacWatchForm #3110

Merged
merged 4 commits into from
Nov 5, 2024
Merged

Uncrispify MacWatchForm #3110

merged 4 commits into from
Nov 5, 2024

Conversation

stveit
Copy link
Contributor

@stveit stveit commented Oct 8, 2024

Fixes #3109

when this and #3108 is merged then NavSubmit can be removed (realistically the one that is merged last will also delete it)

Urls:
http://localhost/macwatch/add/

@stveit stveit added the refactor label Oct 8, 2024
@stveit stveit self-assigned this Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 992 0 11.4s
✅ PYTHON ruff 987 0 0.1s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copy link

github-actions bot commented Oct 8, 2024

Test results

    9 files      9 suites   8m 8s ⏱️
2 136 tests 2 136 ✅ 0 💤 0 ❌
4 011 runs  4 011 ✅ 0 💤 0 ❌

Results for commit d3a9d7e.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 60.44%. Comparing base (78439e7) to head (d3a9d7e).
Report is 33 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3110      +/-   ##
==========================================
- Coverage   60.44%   60.44%   -0.01%     
==========================================
  Files         605      605              
  Lines       43765    43757       -8     
  Branches       48       48              
==========================================
- Hits        26455    26447       -8     
  Misses      17298    17298              
  Partials       12       12              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@johannaengland johannaengland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems pretty good, just a few questions.

python/nav/web/macwatch/forms.py Outdated Show resolved Hide resolved
@@ -37,11 +35,14 @@ class MacWatchForm(forms.Form):

def __init__(self, *args, **kwargs):
super(MacWatchForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_action = '.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know if it matters that this form_action is removed? Seems pretty strange to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like it does nothing tbh, everything works fine as far as I can tell

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could have been a difference if there wasn't a trailing slash in the URL https://stackoverflow.com/a/32076661.
Unless this form is used as a widget on main page (which renders without trailing slash), there shouldn't be a problem with removing form_action here.

python/nav/web/macwatch/forms.py Show resolved Hide resolved
Copy link

sonarcloud bot commented Oct 10, 2024

@stveit
Copy link
Contributor Author

stveit commented Oct 10, 2024

Rebased on master since #3108 was merged so I could remove NavSubmit

Copy link
Contributor

@johannaengland johannaengland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! But I would still wait for @podliashanyk's review before merging.

@@ -37,11 +35,14 @@ class MacWatchForm(forms.Form):

def __init__(self, *args, **kwargs):
super(MacWatchForm, self).__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_action = '.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There could have been a difference if there wasn't a trailing slash in the URL https://stackoverflow.com/a/32076661.
Unless this form is used as a widget on main page (which renders without trailing slash), there shouldn't be a problem with removing form_action here.

python/nav/web/macwatch/forms.py Show resolved Hide resolved
@stveit stveit merged commit 012c1e2 into master Nov 5, 2024
12 of 14 checks passed
@stveit stveit deleted the uncrispify/MacWatchForm branch November 5, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncrispify python/nav/web/macwatch/forms.py:MacWatchForm
3 participants