Skip to content

Commit

Permalink
Merge branch 'master' into SKIL-202
Browse files Browse the repository at this point in the history
  • Loading branch information
ebanderson3 committed Nov 21, 2024
2 parents 6bb1e99 + 5ea7a10 commit 839bc31
Show file tree
Hide file tree
Showing 93 changed files with 2,831 additions and 1,237 deletions.
63 changes: 63 additions & 0 deletions AWS/maintenance.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SkillBuilder - System Maintenance</title>
<!-- Favicon for various platforms -->
<link rel="icon" type="image/svg+xml" href="/FrontEndReact/public/sbLogo.png">
<link rel="icon" type="image/png" sizes="32x32" href="/FrontEndReact/public/sbLogo.png">
<link rel="icon" type="image/png" sizes="16x16" href="/FrontEndReact/public/sbLogo.png">
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: #f5f5f5;
}
.container {
text-align: center;
padding: 2rem;
max-width: 600px;
background-color: white;
border-radius: 8px;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.logo {
width: 120px;
height: auto;
margin-bottom: 2rem;
}
h1 {
color: #2c5282;
margin-bottom: 1rem;
}
p {
color: #4a5568;
line-height: 1.6;
margin-bottom: 1.5rem;
}
.status-badge {
background-color: #2c5282;
color: white;
padding: 0.5rem 1rem;
border-radius: 9999px;
display: inline-block;
font-size: 0.875rem;
}
</style>
</head>
<body>
<div class="container">
<img src="/FrontEndReact/public/sbLogo.png" alt="SkillBuilder Logo" class="logo">
<h1>System Maintenance</h1>
<p>We're currently performing scheduled maintenance to improve your SkillBuilder experience. Our team is working to bring the system back online as quickly as possible.</p>
<p>Thank you for your patience.</p>
<div class="status-badge">System Status: Maintenance in Progress</div>
</div>
</body>
</html>
117 changes: 77 additions & 40 deletions BackEndFlask/Functions/customExceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,20 @@ def __str__(self):
return self.message

class TooManyColumns(Exception):
def __init__(self):
self.message = "Raised when the submitted file has more columns than excepted"
def __init__(self, row_num: int, expected: int, found: int):
self.row_num = row_num
self.expected = expected
self.found = found
self.message = f"Row {row_num} has {found} columns, expected maximum of {expected}"
def __str__(self):
return self.message

class NotEnoughColumns(Exception):
def __init__(self):
self.message = "Raised when the submitted file has less columns than expected"
def __init__(self, row_num: int, expected: int, found: int):
self.row_num = row_num
self.expected = expected
self.found = found
self.message = f"Row {row_num} has {found} columns, expected minimum of {expected}"
def __str__(self):
return self.message

Expand All @@ -36,26 +42,8 @@ def __str__(self):
return self.message

class UserDoesNotExist(Exception):
def __init__(self):
self.message = "Raised when the submitted file has one email not associated to an existing user"
def __str__(self):
return self.message

class UsersDoNotExist(Exception):
def __init__(self):
self.message = "Raised when the submitted file has more than one email not associated to an existing user"
def __str__(self):
return self.message

class TANotYetAddedToCourse(Exception):
def __init__(self):
self.message = "Raised when the submitted file has an existing TA who has not been assigned to the course"
def __str__(self):
return self.message

class StudentNotEnrolledInThisCourse(Exception):
def __init__(self):
self.message = "Raised when the submitted file has a student email associated to an existing student who is not enrolled in the course"
def __init__(self, email):
self.message = f"No user found with email: {email}"
def __str__(self):
return self.message

Expand All @@ -78,20 +66,8 @@ def __str__(self):
return self.message

class InvalidLMSID(Exception):
def __init__(self):
self.message = "Raise when an expected lms_id is not an integer"
def __str__(self):
return self.message

class OwnerIDDidNotCreateTheCourse(Exception):
def __init__(self):
self.message = "Raised when the specified owner did not create the corresponding course"
def __str__(self):
return self.message

class CourseDoesNotExist(Exception):
def __init__(self):
self.message = "Raised when course id passed is not a valid course id"
def __init__(self, row_num, lms_id):
self.message = f"Row {row_num}: LMS ID '{lms_id}' must be a positive integer"
def __str__(self):
return self.message

Expand Down Expand Up @@ -138,8 +114,69 @@ def __init__(self):
def __str__(self):
return self.message


class InvalidNameFormat(Exception):
def __init__(self, row_num, name):
self.message = f"Row {row_num}: Name '{name}' is not in format 'Last Name, First Name'"
def __str__(self):
return self.message

class InvalidEmail(Exception):
def __init__(self, row_num, email):
self.message = f"Row {row_num}: Invalid email format '{email}'"
def __str__(self):
return self.message

class DuplicateEmail(Exception):
def __init__(self, email, row_nums):
self.message = f"Email '{email}' appears multiple times in rows: {row_nums}"
def __str__(self):
return self.message

class DuplicateLMSID(Exception):
def __init__(self, lms_id, row_nums):
self.message = f"LMS ID '{lms_id}' appears multiple times in rows: {row_nums}"
def __str__(self):
return self.message

class InvalidRole(Exception):
def __init__(self):
self.message = "Raised when a role is not valid"
def __init__(self, row_num, role, valid_roles):
self.message = f"Row {row_num}: '{role}' is not a valid role. Valid roles are: {', '.join(valid_roles)}"
def __str__(self):
return self.message

class UsersDoNotExist(Exception):
def __init__(self, emails):
self.message = f"Multiple users not found with emails: {', '.join(emails)}"
def __str__(self):
return self.message

class TANotYetAddedToCourse(Exception):
def __init__(self, email):
self.message = f"TA with email {email} exists but is not assigned to this course"
def __str__(self):
return self.message

class StudentNotEnrolledInThisCourse(Exception):
def __init__(self, email):
self.message = f"Student with email {email} exists but is not enrolled in this course"
def __str__(self):
return self.message

class CourseDoesNotExist(Exception):
def __init__(self, course_id):
self.message = f"No course found with ID: {course_id}"
def __str__(self):
return self.message

class OwnerIDDidNotCreateTheCourse(Exception):
def __init__(self, owner_id, course_id):
self.message = f"User {owner_id} is not the owner of course {course_id}"
def __str__(self):
return self.message

class EmptyFile(Exception):
def __init__(self):
self.message = "The submitted file is empty"
def __str__(self):
return self.message
Loading

0 comments on commit 839bc31

Please sign in to comment.