-
Notifications
You must be signed in to change notification settings - Fork 2
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
Remove ProgramsView from students learning menu; Add autofail_ungraded functional and tests #800
Conversation
class Command(BaseCommand): | ||
help = """ | ||
Set grade to fail for all ungraded students. Only in courses of current semester by default. | ||
Set --prev-sem flag to apply for courses from Autumn 2020 till previous semester. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Зачем реализована такая странная логика? Почему в этом случае явно не запрашивать указание семестра?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По аналогии с автоматическим выставлением оценок по проектам, по дефолту изменяется действующий сем. Сделано, как я понимаю, в основном в качестве защиты от дурака, чтобы невозможно было поменять наследие. Флаг придуман, чтобы можно было единократно запустить этот скрипт на проде и почистить все оценки до 2020 года. Доступа к нему нет из UI сайта.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Осень 2020 года выбран как последний важный сем. Предполагается, что не существует действующих студентов, поступивших раньше.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если нужно запустить один раз, то это не должно потом храниться вечно в репозитории.
enrollments = enrollments.filter(grade=GradeTypes.NOT_GRADED, | ||
course__semester=current_term, | ||
student_profile__branch__site__domain=site) | ||
graded = enrollments.update(grade=GradeTypes.UNSATISFACTORY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хорошо бы записать куда-то в лог, что было изменено. Пусть даже операция без отката, но у тебя хоть какой-то будет механизм восстановления.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Логировать все измененные enrollments не вариант, поскольку писать в консоль 6000+ записей это не только долго, но и бессмысленно. Ибо неясно каким образом это хоть как-то использовать. Добавлю логирование семестра измененных отметок.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
логирование оно же не только в консоль, но и в файл должно быть
apps/staff/urls.py
Outdated
@@ -17,7 +17,7 @@ | |||
ProgressReportForSemesterView, ProgressReportFullView, StudentFacesView, | |||
StudentSearchCSVView, StudentSearchView, SurveySubmissionsReportView, | |||
SurveySubmissionsStatsView, WillGraduateStatsReportView, autograde_projects, | |||
create_alumni_profiles | |||
autofail_ungraded, create_alumni_profiles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Стиль именования этих view отличается, стоит сделать тоже CamelCase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не view, поэтому и отличается. Это кастомные команды django-admin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тогда странно, что они таким образом смешиваются в импорте
Checklist:
print
statements, unrelated template context variables, commented code, etc)