Commit d0a7941b2066aad3eb12f85dd7a208a97adae115
Exists in
master
and in
8 other branches
Merge branch 'master' of https://gitlab.com/noosfero-plugins/proposals_discussion
Showing
2 changed files
with
5 additions
and
1 deletions
Show diff stats
controllers/myprofile/proposals_discussion_plugin_tasks_controller.rb
| 1 | class ProposalsDiscussionPluginTasksController < TasksController | 1 | class ProposalsDiscussionPluginTasksController < TasksController |
| 2 | 2 | ||
| 3 | + protect [:perform_task, :view_tasks], :profile, :only => [:index, :save_tags, :search_tags, :save_categories] | ||
| 4 | + protect :perform_task, :profile, :except => [:index, :save_tags, :search_tags, :save_categories] | ||
| 5 | + | ||
| 3 | def index | 6 | def index |
| 4 | @rejection_email_templates = profile.email_templates.find_all_by_template_type(:task_rejection) | 7 | @rejection_email_templates = profile.email_templates.find_all_by_template_type(:task_rejection) |
| 5 | @acceptance_email_templates = profile.email_templates.find_all_by_template_type(:task_acceptance) | 8 | @acceptance_email_templates = profile.email_templates.find_all_by_template_type(:task_acceptance) |
lib/proposals_discussion_plugin/proposal_task.rb
| @@ -301,7 +301,8 @@ class ProposalsDiscussionPlugin::ProposalTask < Task | @@ -301,7 +301,8 @@ class ProposalsDiscussionPlugin::ProposalTask < Task | ||
| 301 | end | 301 | end |
| 302 | 302 | ||
| 303 | def proposal_source | 303 | def proposal_source |
| 304 | - article_parent.name | 304 | + parent = article_parent |
| 305 | + parent.name if parent | ||
| 305 | end | 306 | end |
| 306 | 307 | ||
| 307 | protected | 308 | protected |