freedomofpress / securethenews

An automated scanner and web dashboard for tracking TLS deployment across news organizations
https://securethe.news
GNU Affero General Public License v3.0
102 stars 25 forks source link

STN-69 Header levels #52

Closed garrettr closed 7 years ago

garrettr commented 7 years ago

Support choosing a heading level (h1-h6) in the Heading StreamField block type. Defaults to "h1" (largest possible heading).

garrettr commented 7 years ago

I think this is ready to merge; I'm just going to test the migration to make sure it will successfully migrate Heading blocks from the previous schema.

garrettr commented 7 years ago

Testing Procedure

  1. git checkout master
  2. Delete development DB.
  3. Create new DB with schema from master: manage.py migrate
  4. /manage.py createsuperuser to use for logging in to admin.
  5. Create a new Content Page with a Heading block in the Body Streamfield. Publish it.
  6. git checkout header-levels
  7. manage.py migrate
  8. Refresh test Content Page

Sadly, this lead to an error:

TypeError at /test/
string indices must be integers
conorsch commented 7 years ago

@garrettr Is this still important?

garrettr commented 7 years ago

@conorsch I'll close it for now. It's not that important, but more importantly I realized after doing the failed test in https://github.com/freedomofpress/securethenews/pull/52#issuecomment-264550902 that migrating changes to StreamFields is a huge PITA. I don't think it's worth the effort at this point.

conorsch commented 7 years ago

migrating changes to StreamFields is a huge PITA. I don't think it's worth the effort at this point.

StreamFields are too awesome not to have a major caveat like that!