devilry / devilry-django

Devilry project main repository
http://devilry.org
BSD 3-Clause "New" or "Revised" License
51 stars 24 forks source link

Partial fix to reduce email notifications to examiners #1285

Closed torgeirl closed 5 months ago

torgeirl commented 7 months ago

As discussed in #1052, examiners receive too many notifications. And until we have time to address the issue fully we should at least add a partial fix:

In order to address this while focusing on more pressing issues I suggest the following tweak to email notifications:

  • do not send an email notification assigned examiner(s) about uploads without comment text made before original deadline

It's not a big change and doesn't involve UI changes, but should reduce emails notifications to examiners significantly while still making sure that they receive important notifications (message text could be questions about deadline extensions; deliveries after the original deadline could be unexpected/not planned for).

Levijatan commented 6 months ago

Implemented in 2887ff5

torgeirl commented 6 months ago

Delivery is uploaded, but the student gets a HTTP 500 and doesn't receive their "delivery receipt" comfirmation email:

AttributeError: 'ForwardManyToOneDescriptor' object has no attribute 'group'
  File "django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "cradmin_legacy/crapp.py", line 86, in viewwrapper
    return has_access_to_cradmin_instance(cradminview(view))(request, *args, **kwargs)
  File "cradmin_legacy/decorators.py", line 32, in wrapper
    return view_function(request, *args, **kwargs)
  File "cradmin_legacy/decorators.py", line 70, in wrapper
    response = view_function(request, *args, **kwargs)
  File "django/utils/decorators.py", line 134, in _wrapper_view
    response = view_func(request, *args, **kwargs)
  File "django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "devilry/devilry_group/views/cradmin_feedbackfeed_base.py", line 144, in post
    return super(FeedbackFeedBaseView, self).post(request=request, *args, **kwargs)
  File "django/views/generic/edit.py", line 184, in post
    return super().post(request, *args, **kwargs)
  File "django/views/generic/edit.py", line 153, in post
    return self.form_valid(form)
  File "cradmin_legacy/viewhelpers/crudbase.py", line 235, in form_valid
    self.object = self.save_object(form)
  File "devilry/devilry_group/views/student/feedbackfeed_student.py", line 65, in save_object
    return super(StudentFeedbackFeedView, self).save_object(form, commit=True)
  File "devilry/devilry_group/views/cradmin_feedbackfeed_base.py", line 524, in save_object
    self.perform_after_save(comment=groupcomment)
  File "devilry/devilry_group/views/student/feedbackfeed_student.py", line 68, in perform_after_save
    self.__send_comment_email(comment=comment)
  File "devilry/devilry_group/views/student/feedbackfeed_student.py", line 56, in __send_comment_email
    before_original_deadline = self.model.feedback_set.group.parentnode.first_deadline > timezone.now()
torgeirl commented 5 months ago

Solved with 352301b.