Skip to content

Commit

Permalink
Fix X-AUTH-TOKEN
Browse files Browse the repository at this point in the history
  • Loading branch information
Clue88 committed Oct 27, 2023
1 parent 30a6823 commit 85ca83e
Show file tree
Hide file tree
Showing 5 changed files with 1,764 additions and 171 deletions.
2 changes: 0 additions & 2 deletions backend/degree/management/commands/fetch_degreeplans.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ def handle(self, *args, **kwargs):
name = getenv("NAME")
assert name is not None

print(pennid, auth_token, refresh_token, name)

client = DegreeworksClient(
pennid=pennid, auth_token=auth_token, refresh_token=refresh_token, name=name
)
Expand Down
132 changes: 113 additions & 19 deletions backend/degree/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,129 @@ class Migration(migrations.Migration):

initial = True

dependencies = [
]
dependencies = []

operations = [
migrations.CreateModel(
name='DegreePlan',
name="DegreePlan",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('program', models.CharField(choices=[('EU_BSE', 'Engineering BSE'), ('EU_BAS', 'Engineering BAS'), ('AU_BA', 'College BA'), ('WU_BS', 'Wharton BS')], help_text='\nThe program code for this degree plan, e.g., EU_BSE\n', max_length=10)),
('degree', models.CharField(help_text='\nThe degree code for this degree plan, e.g., BSE\n', max_length=4)),
('major', models.CharField(help_text='\nThe major code for this degree plan, e.g., BIOL\n', max_length=4)),
('concentration', models.CharField(help_text='\nThe concentration code for this degree plan, e.g., BMAT\n', max_length=4, null=True)),
('year', models.IntegerField(help_text='\nThe effective year of this degree plan, e.g., 2023\n')),
(
"id",
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
(
"program",
models.CharField(
choices=[
("EU_BSE", "Engineering BSE"),
("EU_BAS", "Engineering BAS"),
("AU_BA", "College BA"),
("WU_BS", "Wharton BS"),
],
help_text="\nThe program code for this degree plan, e.g., EU_BSE\n",
max_length=10,
),
),
(
"degree",
models.CharField(
help_text="\nThe degree code for this degree plan, e.g., BSE\n",
max_length=4,
),
),
(
"major",
models.CharField(
help_text="\nThe major code for this degree plan, e.g., BIOL\n",
max_length=4,
),
),
(
"concentration",
models.CharField(
help_text="\nThe concentration code for this degree plan, e.g., BMAT\n",
max_length=4,
null=True,
),
),
(
"year",
models.IntegerField(
help_text="\nThe effective year of this degree plan, e.g., 2023\n"
),
),
],
),
migrations.CreateModel(
name='Rule',
name="Rule",
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(blank=True, help_text='\nThe title for this rule.\n', max_length=200)),
('num_courses', models.PositiveSmallIntegerField(help_text='\nThe minimum number of courses or subrules required for this rule. Only non-null\nif this is a Rule leaf.\n', null=True)),
('credits', models.DecimalField(decimal_places=2, help_text='\nThe minimum number of CUs required for this rule. Only non-null\nif this is a Rule leaf. Can be \n', max_digits=4, null=True)),
('q', models.TextField(help_text='\nString representing a Q() object that returns the set of courses\nsatisfying this rule. Only non-null/non-empty if this is a Rule leaf.\nThis Q object is expected to be normalized before it is serialized\nto a string.\n', max_length=1000)),
('degree_plan', models.ForeignKey(help_text='\nThe degree plan that has this rule.\n', on_delete=django.db.models.deletion.CASCADE, to='degree.degreeplan')),
('parent', models.ForeignKey(help_text="\nThis rule's parent Rule if it has one.\n", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='degree.rule')),
(
"id",
models.BigAutoField(
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
),
),
(
"title",
models.CharField(
blank=True, help_text="\nThe title for this rule.\n", max_length=200
),
),
(
"num_courses",
models.PositiveSmallIntegerField(
help_text="\nThe minimum number of courses or subrules required for this rule. Only non-null\nif this is a Rule leaf.\n",
null=True,
),
),
(
"credits",
models.DecimalField(
decimal_places=2,
help_text="\nThe minimum number of CUs required for this rule. Only non-null\nif this is a Rule leaf. Can be \n",
max_digits=4,
null=True,
),
),
(
"q",
models.TextField(
help_text="\nString representing a Q() object that returns the set of courses\nsatisfying this rule. Only non-null/non-empty if this is a Rule leaf.\nThis Q object is expected to be normalized before it is serialized\nto a string.\n",
max_length=1000,
),
),
(
"degree_plan",
models.ForeignKey(
help_text="\nThe degree plan that has this rule.\n",
on_delete=django.db.models.deletion.CASCADE,
to="degree.degreeplan",
),
),
(
"parent",
models.ForeignKey(
help_text="\nThis rule's parent Rule if it has one.\n",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="children",
to="degree.rule",
),
),
],
),
migrations.AddConstraint(
model_name='rule',
constraint=models.CheckConstraint(check=models.Q(models.Q(('credits__isnull', True), ('credits__gt', 0), _connector='OR'), models.Q(('num_courses__isnull', True), ('num_courses__gt', 0), _connector='OR')), name='num_course_credits_gt_0'),
model_name="rule",
constraint=models.CheckConstraint(
check=models.Q(
models.Q(("credits__isnull", True), ("credits__gt", 0), _connector="OR"),
models.Q(
("num_courses__isnull", True), ("num_courses__gt", 0), _connector="OR"
),
),
name="num_course_credits_gt_0",
),
),
]
35 changes: 25 additions & 10 deletions backend/degree/migrations/0002_auto_20231027_1120.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,38 @@
class Migration(migrations.Migration):

dependencies = [
('degree', '0001_initial'),
("degree", "0001_initial"),
]

operations = [
migrations.AlterField(
model_name='rule',
name='degree_plan',
field=models.ForeignKey(help_text='\nThe degree plan that has this rule. Null if this rule has a parent.\n', null=True, on_delete=django.db.models.deletion.CASCADE, to='degree.degreeplan'),
model_name="rule",
name="degree_plan",
field=models.ForeignKey(
help_text="\nThe degree plan that has this rule. Null if this rule has a parent.\n",
null=True,
on_delete=django.db.models.deletion.CASCADE,
to="degree.degreeplan",
),
),
migrations.AlterField(
model_name='rule',
name='parent',
field=models.ForeignKey(help_text="\nThis rule's parent Rule if it has one. Null if this is a top level rule\n(ie, degree_plan is not null)\n", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='degree.rule'),
model_name="rule",
name="parent",
field=models.ForeignKey(
help_text="\nThis rule's parent Rule if it has one. Null if this is a top level rule\n(ie, degree_plan is not null)\n",
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="children",
to="degree.rule",
),
),
migrations.AlterField(
model_name='rule',
name='q',
field=models.TextField(blank=True, help_text='\nString representing a Q() object that returns the set of courses\nsatisfying this rule. Only non-null/non-empty if this is a Rule leaf.\nThis Q object is expected to be normalized before it is serialized\nto a string.\n', max_length=1000),
model_name="rule",
name="q",
field=models.TextField(
blank=True,
help_text="\nString representing a Q() object that returns the set of courses\nsatisfying this rule. Only non-null/non-empty if this is a Rule leaf.\nThis Q object is expected to be normalized before it is serialized\nto a string.\n",
max_length=1000,
),
),
]
Loading

0 comments on commit 85ca83e

Please sign in to comment.