Skip to content

Commit

Permalink
chore: fixed refactor errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brwali committed Oct 27, 2024
1 parent 1d1216e commit dfd05a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/invitations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def create_utility

def check_user_before_invitation
# user is the student you are inviting to your team
@user = User.find_by(username: params[:user][:name].strip)
@user = User.find_by(username: params[:user][:username].strip)
# User/Author has information about the participant
@student = AssignmentParticipant.find(params[:student_id])
@assignment = Assignment.find(@student.parent_id)
Expand Down
3 changes: 2 additions & 1 deletion app/models/team.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def full?

# Add member to the team, changed to hash by E1776
def add_member(user, _assignment_id = nil)

raise "The user #{user.username} is already a member of the team #{name}" if user?(user)

can_add_member = false
Expand All @@ -87,7 +88,7 @@ def add_member(user, _assignment_id = nil)
parent = TeamNode.find_by(node_object_id: id)
TeamUserNode.create(parent_id: parent.id, node_object_id: t_user.id)
add_participant(parent_id, user)
ExpertizaLogger.info LoggerMessage.new('Model:Team', user.username, "Added member to the team #{id}")
ExpertizaLogger.info LoggerMessage.new('Model:Team', user.name, "Added member to the team #{id}")
end
can_add_member
end
Expand Down
1 change: 1 addition & 0 deletions danger
Submodule danger added at 1ccfed

0 comments on commit dfd05a7

Please sign in to comment.