Skip to content

Commit

Permalink
Improve dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
mureytasroc committed Oct 29, 2023
1 parent 1d2cec7 commit d849ad3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
6 changes: 0 additions & 6 deletions backend/courses/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,6 @@ def get_object(self, request, object_id, from_field=None):
self.obj = super().get_object(request, object_id, from_field)
return self.obj

def formfield_for_manytomany(self, db_field, request, **kwargs):
# Filter displayed restrictions by whether this section has that restriction
if db_field.name == "pre_ngss_restrictions":
kwargs["queryset"] = PreNGSSRestriction.objects.filter(sections__id=self.obj.id)
return super().formfield_for_manytomany(db_field, request, **kwargs)

def course_link(self, instance):
link = reverse("admin:courses_course_change", args=[instance.course.id])
return format_html('<a href="{}">{}</a>', link, instance.course.__str__())
Expand Down
19 changes: 19 additions & 0 deletions backend/plan/migrations/0009_alter_schedule_sections.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 3.2.21 on 2023-10-29 23:01

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('courses', '0059_merge_20230816_2208'),
('plan', '0008_alter_primaryschedule_unique_together_and_more'),
]

operations = [
migrations.AlterField(
model_name='schedule',
name='sections',
field=models.ManyToManyField(blank=True, help_text='\nThe class sections which comprise the schedule. The semester of each of these sections is\nassumed to match the semester defined by the semester field below.\n', to='courses.Section'),
),
]
1 change: 1 addition & 0 deletions backend/plan/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Schedule(models.Model):

sections = models.ManyToManyField(
Section,
blank=True,
help_text=dedent(
"""
The class sections which comprise the schedule. The semester of each of these sections is
Expand Down
4 changes: 2 additions & 2 deletions frontend/plan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "node server.js",
"dev": "export NODE_OPTIONS=--openssl-legacy-provider && node server.js",
"build": "next build",
"start": "NODE_ENV=production node server.js",
"test": "echo no tests yet",
Expand Down Expand Up @@ -66,4 +66,4 @@
"prettier": "^2.0.5",
"redux-logger": "^3.0.6"
}
}
}

0 comments on commit d849ad3

Please sign in to comment.