Merge Request #146

Merged
softwarepublico/softwarepublico!146
Created by Luciano Prestes

Fix no license

Arrumado o bug de ter softwares sem licensas, que devido a isso algumas telas quebravam.

Closes #363

Assignee: Daniela Feitosa
Milestone: None

Merged by Daniela Feitosa

Source branch has been removed
Commits (1)
  •  * Add a migration to fix softwares with no license
     * Add validates presence of license on software_info
     * Add test to not save software_info without license
    
    Signed-off-by: Gabriel Silva <gabriel93.silva@gmail.com>
    Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com>
    Signed-off-by: Omar Junior <omarroinuj@gmail.com>
    Signed-off-by: Pedro de Lyra <pedrodelyra@gmail.com>
    Gabriel Silva
     
4 participants
  • D06c8bf1c58ad143edc3f9314c51ed9f?s=40&d=identicon
    Luciano Prestes @lucianopc

    Added 1 new commit:

    • e7d811b3 - Add test to not save software_info without license
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela

    Added 5 new commits:

    • 61b19097 - Bump noosfero release
    • e234e68c - Fix categories link on software catalog
    • db500605 - Removes suspension points in buttons.
    • 8880af6d - Merge branch 'button_suspension_points_remove' into 'master'
    • a0d199ee - Validates presence of license on software_info
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela

    Quando clica para editar o software e tenta salvar, dá erro:

    ActiveRecord::RecordNotFound (Couldn't find LicenseInfo with id=):
      config/plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:109:in `create_software'
      config/plugins/software_communities/controllers/software_communities_plugin_myprofile_controller.rb:31:in `edit_software'
    

    Mesmo com o campo license_info_id preenchido, ele não retorna o license_info correto:

    >> s.license_info_id
    => 72
    >> s.license_info
    => #<LicenseInfo id: nil, version: nil, link: nil>
    >> LicenseInfo.find 72
    => #<LicenseInfo id: 72, version: "Another", link: "#">
    
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa started a discussion on the outdated diff
    last updated by Daniela Feitosa
    src/noosfero-spb/software_communities/lib/software_info.rb
    139 139 license = LicenseInfo.find_by_id self.license_info_id
    140 140 license_another = LicenseInfo.find_by_version("Another")
    141 141  
    142   - if license_another && license.id == license_another.id
      142 + if license_another && license && license.id == license_another.id
    1
    • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
      Daniela Feitosa @daniela

      Não entendi pq precisa desse método license_info. SoftwareInfo já "belongs_to" license_info e já retornaria o license_info certo.

      O LicenseInfo.new desse método que está retornando o license_info errado, já que self.another_license_version retorna nil

      Choose File ...   File name...
      Cancel
  • D06c8bf1c58ad143edc3f9314c51ed9f?s=40&d=identicon
    Luciano Prestes @lucianopc

    Added 1 new commit:

    • a0e68afa - Validates presence of license on software_info
    Choose File ...   File name...
    Cancel
  • 800e3af93350753db9dee1864cef10ff?s=40&d=identicon
    Thiago Ribeiro @thiago

    mentioned in issue #654

    Choose File ...   File name...
    Cancel
  • Df604377056e7cd36436e90bf2b9af70?s=40&d=identicon
    Gabriel Silva @gabrielssilva

    Added 1 new commit:

    • bc0a5506 - Validates presence of license on software_info
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela
    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa started a discussion on commit bc0a5506
    last updated by Daniela Feitosa
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela

    mentioned in merge request !139

    Choose File ...   File name...
    Cancel
  • 0743c2eb05e68c92baa5f8c498995a20?s=40&d=identicon
    Daniela Feitosa @daniela

    mentioned in merge request !139

    Choose File ...   File name...
    Cancel