Redirect to a visible config page if the current one doesn't exist.

Review Request #7355 — Created May 29, 2015 and submitted

Information

Djblets
release-0.8.x
7cf9ecb...

Reviewers

On a config forms page, if the selected page doesn't exist (for example, if it
decides it should hide itself), the view would end up showing the nav and
nothing else. This is kind of a crummy experience, especially in the case where
the user was on one page but then it decided to hide itself.

This change adds a check to make sure we're trying to navigate to a visible
page, and if not, will select the first one in the list.

Used this with a config page that would hide itself when requested. Instead of
saving and then showing an empty page, it saves and then shows the first page
in the nav.

Description From Last Updated

Blank line between these.

chipx86chipx86

Can we specifically compare against 0?

chipx86chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/configforms/views.py
    
    Ignored Files:
        djblets/static/djblets/js/configForms/views/pagesView.js
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/configforms/views.py
    
    Ignored Files:
        djblets/static/djblets/js/configForms/views/pagesView.js
    
    
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    Blank line between these.

  3. Show all issues

    Can we specifically compare against 0?

  4. 
      
david
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/configforms/views.py
    
    Ignored Files:
        djblets/static/djblets/js/configForms/views/pagesView.js
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/configforms/views.py
    
    Ignored Files:
        djblets/static/djblets/js/configForms/views/pagesView.js
    
    
  2. 
      
brennie
  1. Ship It!
  2. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.8.x (84870a6)
Loading...