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

Staff #15

Merged
merged 16 commits into from
Jul 15, 2019
Merged

Staff #15

merged 16 commits into from
Jul 15, 2019

Conversation

tylerIams
Copy link
Member

I'd like to merge this into master and write the majority of form signage and new tests on a new branch now that CI is working.

@tylerIams tylerIams requested a review from etrepum July 14, 2019 00:11
@etrepum
Copy link
Member

etrepum commented Jul 14, 2019

I should have a chance to look at this on my flight home tonight

@etrepum etrepum mentioned this pull request Jul 15, 2019
5 tasks
Copy link
Member

@etrepum etrepum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a number of comments that can be addressed separately, it seems safe enough to merge as-is given that we don't have this deployed anywhere yet.



@login_required
def attendance(request):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up notes in #16, this could use input validation and Post/Redirect/Get refactor

return round(average * 100, 2)


def compile_attendance_averages_for_all_courses():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Performance follow-up in #16

attendance/views.py Show resolved Hide resolved
home/templates/home/classroom_detail.html Show resolved Hide resolved
staff/staff_views_helper.py Show resolved Hide resolved
dates = class_offering_meeting_dates(classoffering)
classroom = Classroom.objects.get(course=classoffering.name)
for day in dates:
session = Session.objects.create()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems odd that the Session has so little information associated with it (no day or class or class offering) yet it's uniquely determined by the combination of those things in this implementation.

Copy link
Member Author

@tylerIams tylerIams Jul 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had "date" in the Session model, but switched it to the Attendance model, and each entry in the Attendance model has a Session Id associated with it. The thought was that perhaps an Absent marking in the Attendance model could trigger an email with a file from that day's Session to be auto-generated and sent to the absent student (this comes from my experience of it being a pain to catch students up who are absent and then email me "What did I miss?)"

It wouldn't hurt to put "date" in both Session and Attendance though. Is that what you're thinking I should do?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Session probably should have a foreign key to classroom and the date, so you can find sessions for a class without looking at attendance records. We could populate the description from a template that uses the name of the Classroom and/or ClassOffering.

I think it's fine to have the date be denormalized to both of these tables given how we're querying for it.

staff/staff_views_helper.py Show resolved Hide resolved
staff/templates/email_templates/new_user_email.html Outdated Show resolved Hide resolved
home/templates/home/change_pwd.html Outdated Show resolved Hide resolved
staff/views.py Outdated Show resolved Hide resolved
@etrepum etrepum merged commit fed014d into master Jul 15, 2019
@etrepum etrepum deleted the staff branch July 15, 2019 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants