Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboarding backend #61

Open
wants to merge 63 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a71572a
initial degreeprofile model
ashleymyan Mar 23, 2024
06018b2
Merge branch 'master' of https://github.com/pennlabs/penn-degree-plan
ashleymyan Mar 23, 2024
3fd6dc0
WIP: models, serializers, url, viewsets
ashleymyan Mar 24, 2024
3dcb85e
WIP: test cases for models and api
ashleymyan Mar 25, 2024
55fdbc5
retrigger checks
AaDalal Mar 28, 2024
37a0502
Merge branch 'master' into bump-react-next
AaDalal Mar 28, 2024
2fed696
implemented degreeprofile, coursetaken
ashleymyan Mar 28, 2024
d59c01e
linted
ashleymyan Mar 30, 2024
8472146
typescript fixes
AaDalal Apr 2, 2024
b8920d5
reformat tsconfig and fix type error on Toast->CloseButton, usePlatfo…
AaDalal Apr 2, 2024
7b6e0f4
explain ts-ignores
AaDalal Apr 2, 2024
00ee016
Merge pull request #582 from pennlabs/bump-react-next
AaDalal Apr 2, 2024
f7bb92b
Update frontend readme
AaDalal Apr 2, 2024
42963d1
Merge branch 'master' into aag/merge
AaDalal Apr 2, 2024
e25a65d
Merge pull request #612 from pennlabs/aag/merge
AaDalal Apr 3, 2024
af371b3
regenerate pipfile.lock and yarn.lock
AaDalal Apr 3, 2024
c05b632
merge migrations + fix lockfile + handle django 4 migration in degree…
AaDalal Apr 3, 2024
dc4c294
lint
AaDalal Apr 3, 2024
02cf895
revert linting changes to backend/tests/review
AaDalal Apr 3, 2024
2e14ce5
Revert linting changes to backend/tests/alert/
AaDalal Apr 3, 2024
0886284
Revert linting changes to backend/tests/plan/
AaDalal Apr 3, 2024
bf9869f
Revert linting changes to backend/tests/plan/
AaDalal Apr 3, 2024
97a638e
Revert linting changes to frontend/plan and remove extra package-lock…
AaDalal Apr 3, 2024
6787711
Update deployment dockerfile
AaDalal Apr 3, 2024
2ba621a
clean up frontend tool configs
AaDalal Apr 3, 2024
0b11330
clean up degree-plan deps and fix linting issues
AaDalal Apr 3, 2024
50305ce
fix tests
AaDalal Apr 4, 2024
ecb72c5
change 'DegreeWaitlist' to 'InPDPBeta' in degree/views
AaDalal Apr 4, 2024
bb7f834
fix lint
AaDalal Apr 4, 2024
c8327f3
fix account indicator on PCP
AaDalal Apr 4, 2024
f6d1b47
revert recommendation score change
AaDalal Apr 4, 2024
8bee605
reimport cosine_sim
AaDalal Apr 4, 2024
d31245a
fix cosine_sim import
AaDalal Apr 4, 2024
faa8d4c
isort
AaDalal Apr 4, 2024
d1a3507
fix typescript errors
AaDalal Apr 4, 2024
bf34534
get degree plan to build
AaDalal Apr 4, 2024
07ea506
revert course recommendations code in courses/views.py
AaDalal Apr 4, 2024
b31379b
Merge pull request #613 from pennlabs/aag/pdp-merge
AaDalal Apr 4, 2024
b5e7712
add PDP to GH workflow and k8s kittyhawk config
AaDalal Apr 4, 2024
57f4a01
update package-json to include all required funcitons
AaDalal Apr 4, 2024
5bb7da3
update pdp lint
AaDalal Apr 4, 2024
6c571c4
lint fix
AaDalal Apr 4, 2024
0f868ed
Merge pull request #614 from pennlabs/aag/pdp-devops
AaDalal Apr 4, 2024
1264979
fix next rewrites proxy url
AaDalal Apr 5, 2024
7c14a48
Merge pull request #615 from pennlabs/aag/pdp-fix-proxy-url
AaDalal Apr 5, 2024
ff3ae35
fix next rewrites to be dev only
AaDalal Apr 5, 2024
045f19a
add penndegreeplan.com to backend reverse proxy setup
AaDalal Apr 5, 2024
fd051fa
Merge pull request #616 from pennlabs/aag/pdp-proxy-fixes-2
AaDalal Apr 5, 2024
5ba1875
add PDP favicons/icons for different platforms
AaDalal Apr 5, 2024
d4a2e32
remove extraneous page
AaDalal Apr 5, 2024
d5ca38a
Register PDP models on admin site (#618)
Clue88 Apr 6, 2024
962456d
Fix rule serializer
Clue88 Apr 6, 2024
907f24d
Merge pull request #619 from pennlabs/fix-rule-serializer
Clue88 Apr 6, 2024
61e81a0
Merge pull request #617 from pennlabs/aag/pdp-favicons
AaDalal Apr 6, 2024
a359350
remove to_representation on rule serializer
AaDalal Apr 6, 2024
fc6e17b
lint
Clue88 Apr 6, 2024
2528051
Merge pull request #620 from pennlabs/aag/fix-rule-serializer
Clue88 Apr 6, 2024
39b5e41
initial degreeprofile model
ashleymyan Mar 23, 2024
86c0965
WIP: models, serializers, url, viewsets
ashleymyan Mar 24, 2024
2f2fdfc
WIP: test cases for models and api
ashleymyan Mar 25, 2024
6a55ac6
implemented degreeprofile, coursetaken
ashleymyan Mar 28, 2024
faf3804
linted
ashleymyan Mar 30, 2024
8b98053
Merge branch 'onboarding-backend' of github.com:pennlabs/penn-degree-…
AaDalal Apr 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/courses/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class CourseAdmin(admin.ModelAdmin):
readonly_fields = ("topic", "crosslistings", "course_attributes")
exclude = ("attributes",)
list_filter = ("semester",)
list_display = ("full_code", "semester", "title")
list_display = ("id", "full_code", "semester", "title")

list_select_related = ("department",)

Expand Down
2 changes: 1 addition & 1 deletion backend/courses/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ def satisfying_courses(self):
| Q(id__in=self.courses.all())
)
)


"""
3rd-Party API
Expand Down
12 changes: 11 additions & 1 deletion backend/degree/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from django.urls import reverse
from django.utils.html import format_html

from degree.models import Degree, DegreePlan, DoubleCountRestriction, Rule, SatisfactionStatus, Fulfillment
from degree.models import Degree, DegreePlan, DoubleCountRestriction, Rule, SatisfactionStatus, Fulfillment, DegreeProfile, CourseTaken, UserProfile


# Register your models here.
Expand Down Expand Up @@ -54,3 +54,13 @@ def get_urls(self):
def degree_editor(self, request):
context = dict(self.admin_site.each_context(request))
return TemplateResponse(request, "degree-editor.html", context)


class UserProfileAdmin(admin.ModelAdmin):
list_display = ("id", "user")
admin.site.register(UserProfile, UserProfileAdmin)

class DegreeProfileAdmin(admin.ModelAdmin):
list_display = ("id", "user_profile", "graduation_date")
admin.site.register(DegreeProfile, DegreeProfileAdmin)
admin.site.register(CourseTaken)
2 changes: 1 addition & 1 deletion backend/degree/management/commands/fetch_degrees.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from courses.util import get_current_semester
from degree.management.commands.deduplicate_rules import deduplicate_rules
from degree.models import Degree, program_code_to_name
from degree.models import Degree, program_code_to_name, add_course,
from degree.utils.degreeworks_client import DegreeworksClient
from degree.utils.parse_degreeworks import parse_and_save_degreeworks

Expand Down
58 changes: 58 additions & 0 deletions backend/degree/migrations/0008_auto_20240324_1246.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Generated by Django 3.2.24 on 2024-03-24 16:46

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('courses', '0066_course_credits'),
('degree', '0007_alter_dockedcourse_full_code'),
]

operations = [
migrations.CreateModel(
name='CourseTaken',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('semester', models.CharField(help_text='\nThe semester taken, in the form YYYYx\n', max_length=5)),
('grade', models.CharField(help_text="\nThe user's grade for this course\n", max_length=2)),
('course', models.ForeignKey(help_text='\nA list of course codes that the user has already taken, matched with semester\n', on_delete=django.db.models.deletion.CASCADE, to='courses.course')),
],
),
migrations.AlterField(
model_name='degree',
name='program',
field=models.CharField(choices=[('EU_BSE', 'Engineering BSE'), ('EU_BAS', 'Engineering BAS'), ('AU_BA', 'College BA'), ('WU_BS', 'Wharton BS'), ('NU_BSN', 'Nursing BSN')], help_text='\nThe program code for this degree, e.g., EU_BSE\n', max_length=10),
),
migrations.CreateModel(
name='Transcript',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('program', models.CharField(db_index=True, help_text="\nThe user's current program (e.g. SEAS B.S.)\n", max_length=255)),
('courses', models.ForeignKey(blank=True, help_text='\nCourses already taken, prob a list of Course objects\n', null=True, on_delete=django.db.models.deletion.SET_NULL, to='courses.course')),
],
),
migrations.CreateModel(
name='DegreeProfile',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('graduation_date', models.CharField(help_text="\nThe user's expected graduation date (of the form YYYYx where x is A [for spring],\nB [summer], or C [fall]), e.g. `2019C` for fall 2019)\n", max_length=5)),
('courses_taken', models.ManyToManyField(help_text='\nA list of course codes that the user has already taken, matched with semester\n', related_name='degree_profiles', through='degree.CourseTaken', to='courses.Course')),
('degrees', models.ManyToManyField(help_text="\nThe user's current degree(s)\n", to='degree.Degree')),
('transcript', models.OneToOneField(help_text="The user's uploaded transcript parsed into a Transcript object (optional)", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='degree_profile', to='degree.transcript')),
('transfer_credits', models.ManyToManyField(help_text='\nTransfer credits\n', related_name='transfer_credit_profiles', to='courses.Course')),
('user_profile', models.OneToOneField(help_text='extending the user profile class from courses to store degree plan specific info', on_delete=django.db.models.deletion.CASCADE, related_name='degree_profile', to='courses.userprofile')),
],
),
migrations.AddField(
model_name='coursetaken',
name='degree_profile',
field=models.ForeignKey(help_text='\nThe degree profile belonging to the user that took this course\n', on_delete=django.db.models.deletion.CASCADE, to='degree.degreeprofile'),
),
migrations.AddConstraint(
model_name='coursetaken',
constraint=models.UniqueConstraint(fields=('degree_profile', 'course', 'semester'), name='unique_course_taken'),
),
]
38 changes: 38 additions & 0 deletions backend/degree/migrations/0009_auto_20240324_1730.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 3.2.24 on 2024-03-24 21:30

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('courses', '0066_course_credits'),
('degree', '0008_auto_20240324_1246'),
]

operations = [
migrations.RemoveConstraint(
model_name='coursetaken',
name='unique_course_taken',
),
migrations.AlterField(
model_name='coursetaken',
name='degree_profile',
field=models.ForeignKey(help_text='\nThe degree profile to which this course was taken\n', on_delete=django.db.models.deletion.CASCADE, to='degree.degreeprofile'),
),
migrations.AlterField(
model_name='degreeprofile',
name='courses_taken',
field=models.ManyToManyField(help_text='\nA list of course codes that the user has already taken, matched with semester\n', related_name='degree_profile', through='degree.CourseTaken', to='courses.Course'),
),
migrations.AlterField(
model_name='degreeprofile',
name='transfer_credits',
field=models.ManyToManyField(help_text='\nTransfer credits\n', related_name='transfer_credits_for', to='courses.Course'),
),
migrations.AddConstraint(
model_name='coursetaken',
constraint=models.UniqueConstraint(fields=('degree_profile', 'course', 'semester'), name='unique-degree-profile'),
),
]
25 changes: 25 additions & 0 deletions backend/degree/migrations/0010_auto_20240324_1732.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 3.2.24 on 2024-03-24 21:32

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('degree', '0009_auto_20240324_1730'),
]

operations = [
migrations.RemoveConstraint(
model_name='coursetaken',
name='unique-degree-profile',
),
migrations.AddConstraint(
model_name='coursetaken',
constraint=models.UniqueConstraint(fields=('degree_profile', 'course', 'semester'), name='unique-course-taken'),
),
migrations.AddConstraint(
model_name='degreeprofile',
constraint=models.UniqueConstraint(fields=('user_profile',), name='unique-degree-profile'),
),
]
20 changes: 20 additions & 0 deletions backend/degree/migrations/0011_alter_coursetaken_course.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.24 on 2024-03-24 23:06

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('courses', '0066_course_credits'),
('degree', '0010_auto_20240324_1732'),
]

operations = [
migrations.AlterField(
model_name='coursetaken',
name='course',
field=models.ForeignKey(help_text='\nThe course code (e.g. CIS-1210) of the course taken\n', on_delete=django.db.models.deletion.CASCADE, to='courses.course'),
),
]
20 changes: 20 additions & 0 deletions backend/degree/migrations/0012_alter_coursetaken_course.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.24 on 2024-03-28 05:54

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('courses', '0066_course_credits'),
('degree', '0011_alter_coursetaken_course'),
]

operations = [
migrations.AlterField(
model_name='coursetaken',
name='course',
field=models.ForeignKey(help_text='\nThe full-code (e.g. CIS-1210) of the course taken\n', on_delete=django.db.models.deletion.CASCADE, to='courses.course'),
),
]
20 changes: 20 additions & 0 deletions backend/degree/migrations/0013_alter_coursetaken_course.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 3.2.24 on 2024-03-28 06:33

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('courses', '0066_course_credits'),
('degree', '0012_alter_coursetaken_course'),
]

operations = [
migrations.AlterField(
model_name='coursetaken',
name='course',
field=models.ForeignKey(help_text='\nThe course ID of the course taken\n', on_delete=django.db.models.deletion.CASCADE, to='courses.course'),
),
]
Loading
Loading