Commit 30843686 authored by Daniel W Bond's avatar Daniel W Bond

track student's original peoplefinder majors (requires migration)

parent 28c4f736
......@@ -120,6 +120,12 @@ def create_user(tree):
# also Major.DoesNotExist Error, but the handling for both is the same...
except:
print("Unable to add student's major.")
try:
new_student.original_major = major_obj
new_student.save()
print("Added student's original major, %s, for later reference." % major_name)
except:
print("Unable to add student's original major for later reference.")
print("Student object creation process completed.")
......
......@@ -131,7 +131,7 @@ class Student(TimeStampedModel):
privacy = models.CharField(max_length=100, choices=PRIVACY_CHOICES, default=FLOOR)
room = models.ForeignKey(Room, null=True, blank=True)
major = models.ForeignKey('Major', null=True, blank=True)
major = models.ForeignKey('Major', related_name='major', null=True, blank=True)
times_changed_room = models.PositiveIntegerField(default=0)
......@@ -139,7 +139,8 @@ class Student(TimeStampedModel):
graduating_year = models.IntegerField(default=current_year, blank=True)
# from when first logged in through peoplefinder, stored for later
original_major = models.CharField(max_length=50, blank=True)
original_major = models.ForeignKey('Major', related_name='original_major',
null=True, blank=True)
# social media accounts
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment