title: Submenu href issues
body: <p>I am building a website application for a final course using Flask on an IDE.</p>
  <p>I have a layout.html which I am borrowing as part of other html pages as well.</p>
  <p>I have an issue with my submenu where only one href is clickable on the website and leads to the required html page, whereas the second href just return back to the index while having 302 redirection(seen on the debugger).</p>
  <p>All the other links in my menu are working flawlessly, but I can't get to solve the issue.</p>
  <p>Here is part of my layout.html</p>
  <pre><code>&lt;nav class=&quot;navbar navbar-expand-md navbar-dark bg-dark border&quot;&gt;
              &lt;a class=&quot;navbar-brand&quot; href=&quot;/&quot;&gt;&lt;span class=&quot;red&quot;&gt;Stock Portfolio Manager&lt;/span&gt;&lt;/a&gt;
              &lt;button aria-controls=&quot;navbar&quot; aria-expanded=&quot;false&quot; aria-label=&quot;Toggle navigation&quot; class=&quot;navbar-toggler&quot; data-target=&quot;#navbar&quot; data-toggle=&quot;collapse&quot; type=&quot;button&quot;&gt;
                  &lt;span class=&quot;navbar-toggler-icon&quot;&gt;&lt;/span&gt;
              &lt;/button&gt;
              &lt;div class=&quot;collapse navbar-collapse&quot; id=&quot;navbar&quot;&gt;
                  {% if session.user_id %}
                      &lt;ul class=&quot;navbar-nav mr-auto mt-2&quot;&gt;
                          &lt;li class=&quot;nav-item dropdown&quot;&gt;
                            &lt;a class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; id=&quot;navbarDropdown&quot; role=&quot;button&quot; data-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;
                              Portfolio
                            &lt;/a&gt;
                            &lt;div class=&quot;dropdown-menu&quot; aria-labelledby=&quot;navbarDropdown&quot;&gt;
                                &lt;a class=&quot;dropdown-item&quot; href=&quot;/quote&quot;&gt;Quote&lt;/a&gt;
                                &lt;a class=&quot;dropdown-item&quot; href=&quot;/buy&quot;&gt;Buy&lt;/a&gt;
                                &lt;a class=&quot;dropdown-item&quot; href=&quot;/sell&quot;&gt;Sell&lt;/a&gt;
                                &lt;a class=&quot;dropdown-item&quot; href=&quot;/history&quot;&gt;History&lt;/a&gt;
                            &lt;/div&gt;
                          &lt;/li&gt;
                          &lt;li class=&quot;nav-item dropdown&quot;&gt;
                            &lt;a class=&quot;nav-link dropdown-toggle&quot; href=&quot;#&quot; id=&quot;navbarDropdown&quot; role=&quot;button&quot; data-toggle=&quot;dropdown&quot; aria-haspopup=&quot;true&quot; aria-expanded=&quot;false&quot;&gt;
                              Build a Portfolio 
                            &lt;/a&gt;
                            &lt;ul class=&quot;dropdown-menu&quot; aria-labelledby=&quot;navbarDropdownMenuLink&quot;&gt;
                              &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;/about&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
                              &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;/build&quot;&gt;Build&lt;/a&gt;&lt;/li&gt;
                              &lt;div class=&quot;dropdown-divider&quot;&gt;&lt;/div&gt;
                              &lt;li class=&quot;dropdown-submenu&quot;&gt;
                                  &lt;a class=&quot;dropdown-item dropdown-toggle&quot; data-toggle=&quot;dropdown&quot; href=&quot;#&quot;&gt;User Guide&lt;/a&gt;
                                  &lt;ul class=&quot;dropdown-menu&quot;&gt;
                                      &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;/expected returns&quot;&gt;Expected Returns&lt;/a&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;a class=&quot;dropdown-item&quot; href=&quot;/risk models&quot;&gt;Risk Models&lt;/a&gt;&lt;/li&gt;
                                  &lt;/ul&gt;
                              &lt;/li&gt;
                            &lt;/ul&gt;
                          &lt;/li&gt;
                      &lt;/ul&gt;
                      &lt;ul class=&quot;navbar-nav ml-auto mt-2&quot;&gt;
                          &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;/logout&quot;&gt;Log Out&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  {% else %}
                      &lt;ul class=&quot;navbar-nav ml-auto mt-2&quot;&gt;
                          &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;/register&quot;&gt;Register&lt;/a&gt;&lt;/li&gt;
                          &lt;li class=&quot;nav-item&quot;&gt;&lt;a class=&quot;nav-link&quot; href=&quot;/login&quot;&gt;Log In&lt;/a&gt;&lt;/li&gt;
                      &lt;/ul&gt;
                  {% endif %}
              &lt;/div&gt;
          &lt;/nav&gt; 
  </code></pre>
  <p>The href=&quot;/risk models&quot; does the issues here but it's not because risk models.html has issues, because if I insert it instead of href=&quot;/expected returns&quot; it will work fine.</p>
  <p>Any help will be appreciated.</p>