jazzband / django-two-factor-auth

Complete Two-Factor Authentication for Django providing the easiest integration into most Django projects.
MIT License
1.71k stars 448 forks source link

Prevent empty <ul> from being rendered in profile.html #695

Closed DanielSwain closed 10 months ago

DanielSwain commented 10 months ago

Description

An empty <ul> was being rendered when backup_phones == None. Whitespace was also being rendered between the <ul></ul>.

Motivation and Context

The rendered element causes extra space to appear in the DOM at http://127.0.0.1:8000/account/two_factor/ before the "Add Phone Number" button when no backup phones have been registered.

How Has This Been Tested?

Tested locally at http://127.0.0.1:8000/account/two_factor/. An empty <ul></ul> is no longer rendered when navigating to this url prior to adding any backup phone numbers.

Types of changes

Checklist:

codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (e9dba63) 95.52% compared to head (87f9680) 95.52%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #695 +/- ## ======================================= Coverage 95.52% 95.52% ======================================= Files 78 78 Lines 3354 3354 Branches 377 377 ======================================= Hits 3204 3204 Misses 119 119 Partials 31 31 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.