def set_marks(title, not_responded): mark = Mark() mark.title = "Manglende tilbakemelding på %s" % title mark.category = 4 # Missed feedback mark.description = "Du har fått en prikk fordi du ikke har levert tilbakemelding." mark.save() for user in not_responded: user_entry = MarkUser() user_entry.user = user user_entry.mark = mark user_entry.save()
def set_mark(payment_delay): mark = Mark() mark.title = _( "Manglende betaling på %s") % payment_delay.payment.description() mark.category = 6 # Manglende betaling mark.description = _( "Du har fått en prikk fordi du ikke har betalt for et arrangement." ) mark.save() user_entry = MarkUser() user_entry.user = payment_delay.user user_entry.mark = mark user_entry.save()
def set_marks(payment): mark = Mark() mark.title = _("Manglende betaling på %s") % payment.description() mark.category = 6 # Manglende betaling mark.description = _( "Du har fått en prikk fordi du ikke har betalt for et arrangement." ) mark.save() for user in PaymentReminder.not_paid(payment): user_entry = MarkUser() user_entry.user = user user_entry.mark = mark user_entry.save()
def setMarks(attendance_event, logger=logging.getLogger()): event = attendance_event.event logger.info('Proccessing "' + event.title + '"') mark = Mark() mark.title = "Manglende oppmøte på %s" % (event.title) mark.category = event.event_type mark.description = "Du har fått en prikk på grunn av manglende oppmøte på %s." % (event.title) mark.save() for user in attendance_event.not_attended(): user_entry = MarkUser() user_entry.user = user user_entry.mark = mark user_entry.save() logger.info("Mark given to: " + str(user_entry.user)) attendance_event.marks_has_been_set = True attendance_event.save()