Skip to content

Commit

Permalink
Move default instructor team entity to const
Browse files Browse the repository at this point in the history
  • Loading branch information
xenosf committed Feb 19, 2024
1 parent 80d651e commit 7e960f7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public ParticipantInfo getInfoForIdentifier(String identifier) {
Instructor instructor = getInstructorForEmail(identifier);

name = instructor.getName();
team = instructor.getTeam();
team = Const.USER_TEAM_ENTITY_FOR_INSTRUCTOR;
section = Const.DEFAULT_SECTION_ENTITY;
} else if (isTeam) {
Student teamMember = getTeamToMembersTable().get(identifier).iterator().next();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/teammates/common/util/Const.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.time.Instant;

import teammates.storage.sqlentity.Section;
import teammates.storage.sqlentity.Team;

/**
* Stores constants that are widely used across classes.
Expand All @@ -19,6 +20,7 @@ public final class Const {
public static final String USER_NOBODY_TEXT = "-";

public static final String USER_TEAM_FOR_INSTRUCTOR = "Instructors";
public static final Team USER_TEAM_ENTITY_FOR_INSTRUCTOR = new Team(null, Const.USER_TEAM_FOR_INSTRUCTOR);

public static final String DEFAULT_DISPLAY_NAME_FOR_INSTRUCTOR = "Instructor";

Expand Down
4 changes: 0 additions & 4 deletions src/main/java/teammates/storage/sqlentity/Instructor.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
@Entity
@Table(name = "Instructors")
public class Instructor extends User {

private static Team userTeam = new Team(null, Const.USER_TEAM_FOR_INSTRUCTOR);

@Column(nullable = false)
private boolean isDisplayedToStudents;

Expand All @@ -53,7 +50,6 @@ public Instructor(Course course, String name, String email, boolean isDisplayedT
this.setDisplayName(displayName);
this.setRole(role);
this.setPrivileges(privileges);
this.setTeam(userTeam);
}

public boolean isDisplayedToStudents() {
Expand Down

0 comments on commit 7e960f7

Please sign in to comment.