Skip to content

Commit 60b3aa3

Browse files
palves-ulhtjoao-marques-a22108693
authored andcommitted
add length restriction to the assignment id in several entities
1 parent d85a50b commit 60b3aa3

File tree

7 files changed

+8
-4
lines changed

7 files changed

+8
-4
lines changed

src/main/kotlin/org/dropProject/dao/AssignmentACL.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
*/
2020
package org.dropProject.dao
2121

22+
import javax.persistence.Column
2223
import javax.persistence.Entity
2324
import javax.persistence.GeneratedValue
2425
import javax.persistence.Id
@@ -36,6 +37,7 @@ data class AssignmentACL(
3637
@GeneratedValue
3738
val id: Long = 0,
3839

40+
@Column(length = 50)
3941
val assignmentId: String,
4042
val userId: String
4143
)

src/main/kotlin/org/dropProject/dao/AssignmentReport.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ data class AssignmentReport(
3737
@Id @GeneratedValue
3838
val id: Long = 0,
3939

40-
@Column(nullable = false)
40+
@Column(nullable = false, length = 50)
4141
val assignmentId: String, // assignment.id
4242

4343
@Column(nullable = false)

src/main/kotlin/org/dropProject/dao/AssignmentTags.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ data class AssignmentTagsCompositeKey(
3737
@Entity
3838
@IdClass(AssignmentTagsCompositeKey::class)
3939
data class AssignmentTags(
40-
@Id val assignmentId: String,
40+
@Id @Column(length = 50) val assignmentId: String,
4141
@Id val tagId: Long
4242
)

src/main/kotlin/org/dropProject/dao/GitSubmission.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ data class GitSubmission(
4646
@Id @GeneratedValue
4747
val id: Long = 0,
4848

49+
@Column(length = 50)
4950
val assignmentId: String,
5051
var submitterUserId: String,
5152

src/main/kotlin/org/dropProject/dao/Submission.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ data class Submission(
115115
@JsonView(JSONViews.StudentAPI::class)
116116
var statusDate: Date,
117117

118+
@Column(length = 50)
118119
val assignmentId: String,
119120
val assignmentGitHash: String?,
120121

src/main/resources/messages_en_US.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ student.git.setup.must-fill-url=You must fill the repository's url
4343
student.git.setup.invalid-url=The repository's url is not in the correct format
4444
4545
student.submit.notAGroupElement=The user that is submitting must be an element of the group.
46-
student.submit.invalidGroup=This assignment only accepts submissions from groups with {0..{1} elements.
46+
student.submit.invalidGroup=This assignment only accepts submissions from groups with {0}..{1} elements.
4747
student.submit.pending=The previous submission has not yet been validated. Wait for the report generation before submitting again.
4848
student.submit.fileError=Error processing file
4949

src/test/kotlin/org/dropProject/controllers/UploadControllerTests.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ class UploadControllerTests {
16131613

16141614
val error = testsHelper.uploadProject(this.mvc, "projectOKIndividual", "testJavaProj", STUDENT_1,
16151615
expectedResultMatcher = status().isInternalServerError())
1616-
assertEquals("This assignment only accepts submissions from groups with 2-2 elements.", error)
1616+
assertEquals("This assignment only accepts submissions from groups with 2..2 elements.", error)
16171617

16181618
// add this student to exceptions
16191619
projectGroupRestrictions.exceptions = "student1,student3"

0 commit comments

Comments
 (0)