Update rbmotd for Review Board 4.0

Review Request #11057 — Created June 25, 2020 and submitted

david
rb-extension-pack
master
rb-extension-pack

This change updates the message of the day extension for changes in
Review Board 4.0. This includes moving away from the old patterns
method for creating urlpatterns, and updating for API changes in Djblets
config forms. This also modernizes the codebase a bit, adding
unicode_literals and docstrings.

Activated and configured the motd extension. Verified that everything
worked as expected.

Summary
[rbmotd] Update rbmotd for Review Board 4.0
Description From Last Updated

These should be in the same import group. While here, can you add the standard unicode_literals import?

chipx86chipx86

Can you add some docs while you're here? Took me a few to figure out what this was doing (with ...

chipx86chipx86

"Board"

chipx86chipx86

Probably MotdExtension would be appropriate here.

chipx86chipx86

This would be SafeText. SafeString is bytes on Python 2.

chipx86chipx86

We've only been using * for JavaScript, since there's no base object. For Python, we've been using object.

chipx86chipx86

The module is still safestring, just the class is SafeText.

chipx86chipx86
chipx86
  1. 
      
  2. rbmotd/rbmotd/admin_urls.py (Diff revision 1)
     
     
     
     

    These should be in the same import group.

    While here, can you add the standard unicode_literals import?

  3. rbmotd/rbmotd/forms.py (Diff revision 1)
     
     

    Can you add some docs while you're here? Took me a few to figure out what this was doing (with the self-call to set_key_value()).

  4. 
      
david
chipx86
  1. Looks good. A couple small doc nits.

  2. rbmotd/rbmotd/extension.py (Diff revision 2)
     
     

    "Board"

  3. rbmotd/rbmotd/extension.py (Diff revision 2)
     
     

    Probably MotdExtension would be appropriate here.

  4. rbmotd/rbmotd/extension.py (Diff revision 2)
     
     

    This would be SafeText. SafeString is bytes on Python 2.

  5. rbmotd/rbmotd/forms.py (Diff revision 2)
     
     

    We've only been using * for JavaScript, since there's no base object. For Python, we've been using object.

  6. 
      
david
chipx86
  1. 
      
  2. rbmotd/rbmotd/extension.py (Diff revision 3)
     
     

    The module is still safestring, just the class is SafeText.

  3. 
      
david
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (abe61a6)
Loading...