Bullet-proof some extension and URL uninitialization code.

Review Request #5849 — Created May 21, 2014 and submitted

Information

Djblets
master
7b7779e...

Reviewers

We hit some nasty issues where uninitializing an extension failed hard,
preventing all future attempts at uninitializing. These had to do with
the dynamically-set/removed extension.admin_site attribute, which was
assumed to be available if has_admin_site was True.

We now check for the existence of admin_site instead, and also catch
attempts at removing non-existing URLs in DynamicURLResolver.

Unit tests passed.

Description From Last Updated

This should be wrapped in try/except ValueError too.

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        djblets/extensions/manager.py
        djblets/urls/resolvers.py
      Ignored Files:
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        djblets/extensions/manager.py
        djblets/urls/resolvers.py
      Ignored Files:
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        djblets/extensions/manager.py
        djblets/urls/resolvers.py
      Ignored Files:
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        djblets/extensions/manager.py
        djblets/urls/resolvers.py
      Ignored Files:
    
    
  2. 
      
david
  1. 
      
  2. djblets/extensions/manager.py (Diff revision 1)
     
     
    Show all issues

    This should be wrapped in try/except ValueError too.

  3. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        djblets/extensions/manager.py
        djblets/urls/resolvers.py
      Ignored Files:
    
    
  2. 
      
reviewbot
  1. This is a review from Review Bot.
      Tool: Pyflakes
      Processed Files:
        djblets/extensions/manager.py
        djblets/urls/resolvers.py
      Ignored Files:
    
    
  2. 
      
david
  1. Ship It!

  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (891d566)