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 management profile forms in seedDB #3105

Merged

Conversation

johannaengland
Copy link
Contributor

@johannaengland johannaengland commented 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.32s
✅ PYTHON ruff 987 0 0.08s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

Copy link

github-actions bot commented Oct 8, 2024

Test results

    8 files      8 suites   8m 21s ⏱️
2 047 tests 2 047 ✅  0 💤 0 ❌
3 920 runs  3 910 ✅ 10 💤 0 ❌

Results for commit 1c396cf.

♻️ 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 (9c2586f) to head (1c396cf).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3105   +/-   ##
=======================================
  Coverage   60.44%   60.44%           
=======================================
  Files         605      605           
  Lines       43757    43757           
  Branches       48       48           
=======================================
  Hits        26451    26451           
  Misses      17294    17294           
  Partials       12       12           

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

Copy link
Contributor

@podliashanyk podliashanyk left a comment

Choose a reason for hiding this comment

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

This is an interesting form to refactor. Those forms are quite simple and both self.attrs = set_flat_form_attributes() in forms.py are redundant if combined with suggested changes in the templates (see below).

I originally added the {% if form.attrs %}...{% else %}{{ form }}{% endif %} logic to non-crispy templates purely as a failsafe - if we miss something out, at least basic (no styling and no customization in tag structure) form fields will be rendered. It does add redundancy. So we might need to consider if and when to drop those if else blocks in uncrispyfyed templates.. In this PR there was no crispy helper defined so we use set_flat_form_attributes() just for if else blocks in the template. So if we are going to drop extra failsaving, this PR is a good place to start this discussion

@johannaengland
Copy link
Contributor Author

This is an interesting form to refactor. Those forms are quite simple and both self.attrs = set_flat_form_attributes() in forms.py are redundant if combined with suggested changes in the templates (see below).

I originally added the {% if form.attrs %}...{% else %}{{ form }}{% endif %} logic to non-crispy templates purely as a failsafe - if we miss something out, at least basic (no styling and no customization in tag structure) form fields will be rendered. It does add redundancy. So we might need to consider if and when to drop those if else blocks in uncrispyfyed templates.. In this PR there was no crispy helper defined so we use set_flat_form_attributes() just for if else blocks in the template. So if we are going to drop extra failsaving, this PR is a good place to start this discussion

I have removed all of these if-else blocks in #3128. But we can also already do it now bit by bit, I don't really have a preference.

@johannaengland johannaengland force-pushed the refactor/uncrispify-management-profile-forms-seeddb branch from 0ce9772 to 1c396cf Compare October 11, 2024 08:48
Copy link

sonarcloud bot commented Oct 11, 2024

@johannaengland johannaengland merged commit d96d73b into master Oct 11, 2024
12 of 14 checks passed
@johannaengland johannaengland deleted the refactor/uncrispify-management-profile-forms-seeddb branch October 11, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Uncrispify management profile templates in seedDB
2 participants