Commit 99b8568f authored by Douwe Maan's avatar Douwe Maan

Find correct group membership.

parent 5c4bb6df
......@@ -87,8 +87,7 @@ class ProjectsController < ApplicationController
render 'projects/empty'
else
if current_user
@membership = @project.project_member_by_id(current_user.id)
@group_member = GroupMember.find_by(user_id: current_user.id)
@membership = @project.team.find_member(current_user.id)
end
render :show
......
- return unless [@membership, @group_member].any?
- if @membership
- case @membership
- when ProjectMember
= form_tag profile_notifications_path, method: :put, remote: true, class: 'inline', id: 'notification-form' do
= hidden_field_tag :notification_type, 'project'
= hidden_field_tag :notification_id, @membership.id
......@@ -14,8 +13,8 @@
- Notification.project_notification_levels.each do |level|
= notification_list_item(level, @membership)
- elsif @group_member
.btn.btn-new.disabled#notifications-button
- when GroupMember
.btn.btn-new.disabled
= icon('bell')
= notification_label(@group_member)
= notification_label(@membership)
= icon('angle-down')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment