FIX: Skip themes that have blank URL in the themes:update rake task (#15156)

Themes that are imported via a ZIP file do have a `remote_theme` record in the database but the record has a blank value for the `remote_url` field which means attempting to do an update git via will result in an error.
This commit is contained in:
Osama Sayegh 2021-12-01 19:57:36 +03:00 committed by GitHub
parent 754c2ec6c1
commit 20f736aa11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -56,7 +56,7 @@ def update_themes
Theme.includes(:remote_theme).where(enabled: true, auto_update: true).find_each do |theme|
begin
remote_theme = theme.remote_theme
next if remote_theme.blank?
next if remote_theme.blank? || remote_theme.remote_url.blank?
puts "Updating '#{theme.name}' for '#{RailsMultisite::ConnectionManagement.current_db}'..."
remote_theme.update_from_remote