Commit a0f2837c4da5ca30aff79898ea3a9aaa92287450
Exists in
staging
and in
3 other branches
Merge branch 'not_check_requestor' into 'master'
should not check requestor on approve article task Today if a user is member of a community, make an article suggestion and get out of community, Noosfero create an unprocessable task in community task management See merge request !1011
Showing
2 changed files
with
2 additions
and
6 deletions
Show diff stats
app/models/approve_article.rb
| ... | ... | @@ -9,9 +9,6 @@ class ApproveArticle < Task |
| 9 | 9 | if target.person? && requestor != target |
| 10 | 10 | self.errors.add(:requestor, _('You can not post articles to other users.')) |
| 11 | 11 | end |
| 12 | - if target.organization? && !target.members.include?(requestor) && target.environment.portal_community != target | |
| 13 | - self.errors.add(:requestor, _('Only members can post articles on communities.')) | |
| 14 | - end | |
| 15 | 12 | end |
| 16 | 13 | end |
| 17 | 14 | ... | ... |
test/unit/approve_article_test.rb
| ... | ... | @@ -462,7 +462,7 @@ class ApproveArticleTest < ActiveSupport::TestCase |
| 462 | 462 | assert t2.invalid?(:requestor) |
| 463 | 463 | end |
| 464 | 464 | |
| 465 | - should 'allow only members to be requestors when target is a community' do | |
| 465 | + should 'allow anyone to be requestors when target is a community' do | |
| 466 | 466 | community = fast_create(Community) |
| 467 | 467 | member = fast_create(Person) |
| 468 | 468 | community.add_member(member) |
| ... | ... | @@ -472,8 +472,7 @@ class ApproveArticleTest < ActiveSupport::TestCase |
| 472 | 472 | t2 = ApproveArticle.new(:requestor => non_member, :target => community) |
| 473 | 473 | |
| 474 | 474 | assert t1.valid? |
| 475 | - assert !t2.valid? | |
| 476 | - assert t2.invalid?(:requestor) | |
| 475 | + assert t2.valid? | |
| 477 | 476 | end |
| 478 | 477 | |
| 479 | 478 | should 'allow any user to be requestor whe the target is the portal community' do | ... | ... |