Use correct black version

This commit is contained in:
Christian Cueni 2024-06-26 13:03:20 +02:00
parent 601e014326
commit 88b7212465
5 changed files with 19 additions and 20 deletions

View File

@ -4,5 +4,4 @@ from vbv_lernwelt.course_session_group.models import CourseSessionGroup
@admin.register(CourseSessionGroup) @admin.register(CourseSessionGroup)
class CourseSessionAssignmentAdmin(admin.ModelAdmin): class CourseSessionAssignmentAdmin(admin.ModelAdmin): ...
...

View File

@ -153,9 +153,9 @@ def fetch_course_session_all_users(courses: List[int], excluded_domains=None):
def generate_export_response(cs_users: List[User]) -> HttpResponse: def generate_export_response(cs_users: List[User]) -> HttpResponse:
response = HttpResponse(content_type="text/csv; charset=utf-8") response = HttpResponse(content_type="text/csv; charset=utf-8")
response[ response["Content-Disposition"] = (
"Content-Disposition" f"attachment; filename=edoniq_user_export_{date.today().strftime('%Y%m%d')}.csv"
] = f"attachment; filename=edoniq_user_export_{date.today().strftime('%Y%m%d')}.csv" )
response.write("\ufeff".encode("utf8")) # UTF-8 BOM response.write("\ufeff".encode("utf8")) # UTF-8 BOM

View File

@ -125,9 +125,9 @@ def _handle_feedback_export_action(course_seesions, file_name):
response = HttpResponse( response = HttpResponse(
content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" content_type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
) )
response[ response["Content-Disposition"] = (
"Content-Disposition" f"attachment; filename={make_export_filename(file_name)}"
] = f"attachment; filename={make_export_filename(file_name)}" )
response.write(excel_bytes) response.write(excel_bytes)
return response return response

View File

@ -65,9 +65,9 @@ class TestNotificationService(TestCase):
self.assertFalse(notification.emailed) self.assertFalse(notification.emailed)
def test_send_notification_with_email(self): def test_send_notification_with_email(self):
self.recipient.additional_json_data[ self.recipient.additional_json_data["email_notification_categories"] = (
"email_notification_categories" json.dumps(["USER_INTERACTION"])
] = json.dumps(["USER_INTERACTION"]) )
self.recipient.save() self.recipient.save()
verb = "Anne hat deinen Auftrag bewertet" verb = "Anne hat deinen Auftrag bewertet"
@ -146,9 +146,9 @@ class TestNotificationService(TestCase):
self.assertFalse(notification.emailed) self.assertFalse(notification.emailed)
# when the email was not sent, yet it will still send it afterwards... # when the email was not sent, yet it will still send it afterwards...
self.recipient.additional_json_data[ self.recipient.additional_json_data["email_notification_categories"] = (
"email_notification_categories" json.dumps(["USER_INTERACTION"])
] = json.dumps(["USER_INTERACTION"]) )
self.recipient.save() self.recipient.save()
result = self.notification_service._send_notification( result = self.notification_service._send_notification(
@ -188,9 +188,9 @@ class TestNotificationService(TestCase):
self.assertFalse(self._has_sent_emails()) self.assertFalse(self._has_sent_emails())
# Assert mail is sent if corresponding email notification type is enabled # Assert mail is sent if corresponding email notification type is enabled
self.recipient.additional_json_data[ self.recipient.additional_json_data["email_notification_categories"] = (
"email_notification_categories" json.dumps(["USER_INTERACTION"])
] = json.dumps(["USER_INTERACTION"]) )
self.recipient.save() self.recipient.save()
self.notification_service._send_notification( self.notification_service._send_notification(
sender=self.sender, sender=self.sender,

View File

@ -39,9 +39,9 @@ class SelfEvaluationFeedbackSerializer(serializers.ModelSerializer):
return obj.learning_unit.get_circle().title return obj.learning_unit.get_circle().title
def get_criteria(self, obj): def get_criteria(self, obj):
performance_criteria: List[ performance_criteria: List[PerformanceCriteria] = (
PerformanceCriteria obj.learning_unit.performancecriteria_set.all()
] = obj.learning_unit.performancecriteria_set.all() )
criteria = [] criteria = []