mysociety / belgium-theme

The Alaveteli theme for Belgian site Transparencia
https://transparencia.be/
MIT License
1 stars 2 forks source link

Upgrade to 0.31 #69

Closed garethrees closed 6 years ago

garethrees commented 6 years ago
garethrees commented 6 years ago

Tell @Gemmamysoc when this is done RE: https://github.com/mysociety/belgium-theme/pull/70

garethrees commented 6 years ago

Seeing this in the log:

Started GET "/country_message" for 10.10.10.1 at 2018-02-14 12:32:01 +0000
Processing by ServicesController#other_country_message as HTML
  User Load (0.6ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1  [["id", 8]]
   (0.3ms)  BEGIN
  User Exists (0.6ms)  SELECT  1 AS one FROM "users" WHERE (LOWER("users"."email") = LOWER('annie@localhost') AND "users"."id" != 8) LIMIT 1
   (0.3ms)  ROLLBACK
Completed 500 Internal Server Error in 15ms (ActiveRecord: 1.8ms)

NameError (undefined local variable or method `province_was' for #<User:0x0000000d4fe518>):
  lib/themes/belgium-theme/lib/model_patches.rb:56:in `province_not_removed'
  app/controllers/application_controller.rb:92:in `set_gettext_locale'
  lib/strip_empty_sessions.rb:13:in `call'
garethrees commented 6 years ago

Hadn't run theme custom migrations:

require '/home/vagrant/alaveteli/lib/themes/belgium-theme/db/migrate/belgium_theme_add_postcode_and_province_to_user'
BelgiumThemeAddPostcodeAndProvinceToUser.up
garethrees commented 6 years ago

Lots of cron tasks needed to get added for 0.31.0.0+

0 0 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/delete-expired-embargoes.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/delete-expired-embargoes || echo "stalled?"
0 5 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/update-overdue-info-request-events.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/update-overdue-info-request-events || echo "stalled?"
0 9 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-embargoes-expiring.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-embargoes-expiring || echo "stalled?"
0 10 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/update-expiring-embargo-info-request-events.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/update-expiring-embargo-info-request-events || echo "stalled?"
0 12 * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/alert-embargoes-expired.lock !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/alert-embargoes-expired || echo "stalled?"
garethrees commented 6 years ago

Needed to give myself pro_admin in the console:

User.find_by(email: '').add_role :pro_admin
garethrees commented 6 years ago

Somehow the pro_admin role got created, but pro didn't:

Role.pluck :name
# => ["admin", "pro_admin"]

Ran the seed code manually:

  ['pro', 'pro_admin'].each do |role_name|
    if Role.where(:name => role_name).empty?
      Role.create(:name => role_name)
    end
  end
garethrees commented 6 years ago

Done

garethrees commented 6 years ago

Oh, and technically we dropped support for Wheezy in 0.31, but given config/packages didn't change and we already have a more modern Ruby, it all seems fine.