From fabe05ba541dade9a5a3718c6a8d8dfdf21ea18c Mon Sep 17 00:00:00 2001 From: Andrew Lalis Date: Sun, 21 Apr 2019 00:00:55 +0200 Subject: [PATCH] Removed sensitive info. --- .../entity/student_teams/GenerateRepositories.java | 2 +- .../teaching_assistant_assistant/model/Course.java | 14 ++++++++++++++ .../util/team_importing/StudentTeamImporter.java | 10 ---------- src/main/resources/templates/courses/create.html | 12 +++++++++--- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java index a0818a4..07717c5 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/controllers/courses/entity/student_teams/GenerateRepositories.java @@ -39,7 +39,7 @@ public class GenerateRepositories { optionalCourse.ifPresent(course -> { course.setGithubOrganizationName("InitializerTesting"); try { - GithubManager manager = new GithubManager("andrewlalis", "scrubstub43"); + GithubManager manager = new GithubManager(course.getApiKey()); manager.generateStudentTeamRepository(course.getStudentTeams().get(0)); } catch (IOException e) { e.printStackTrace(); diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/model/Course.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/model/Course.java index 97a62f3..8c33111 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/model/Course.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/model/Course.java @@ -38,6 +38,12 @@ public class Course extends BasicEntity { @Column private String githubOrganizationName; + /** + * The API key that will be used for Github interaction with this organization. + */ + @Column + private String apiKey; + /** * The list of assignments this course contains. */ @@ -142,6 +148,14 @@ public class Course extends BasicEntity { this.githubOrganizationName = name; } + public String getApiKey() { + return this.apiKey; + } + + public void setApiKey(String key) { + this.apiKey = key; + } + public List getAssignments() { return assignments; } diff --git a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/team_importing/StudentTeamImporter.java b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/team_importing/StudentTeamImporter.java index 774991d..560b33b 100644 --- a/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/team_importing/StudentTeamImporter.java +++ b/src/main/java/nl/andrewlalis/teaching_assistant_assistant/util/team_importing/StudentTeamImporter.java @@ -36,18 +36,8 @@ public class StudentTeamImporter { List studentEntries = extractStudentsFromRecords(records); - System.out.println("<<< Entries (" + studentEntries.size() + ") >>>"); - for (StudentRecordEntry entry : studentEntries) { - System.out.println(entry.toString()); - } - List studentTeams = generateTeamsFromStudentEntries(studentEntries, 0); - System.out.println("<<< Teams (" + studentTeams.size() + ") >>>"); - for (StudentTeam team : studentTeams) { - System.out.println("Team: " + team); - } - return studentTeams; } diff --git a/src/main/resources/templates/courses/create.html b/src/main/resources/templates/courses/create.html index a90b098..4751be5 100644 --- a/src/main/resources/templates/courses/create.html +++ b/src/main/resources/templates/courses/create.html @@ -11,11 +11,17 @@

- + + - + + - + + + + +