chore: format
This commit is contained in:
parent
d4cb978de3
commit
75351b9986
|
|
@ -10,9 +10,6 @@ from django.views import defaults as default_views
|
||||||
from django.views.decorators.csrf import csrf_exempt
|
from django.views.decorators.csrf import csrf_exempt
|
||||||
from django_ratelimit.exceptions import Ratelimited
|
from django_ratelimit.exceptions import Ratelimited
|
||||||
from graphene_django.views import GraphQLView
|
from graphene_django.views import GraphQLView
|
||||||
from wagtail import urls as wagtail_urls
|
|
||||||
from wagtail.admin import urls as wagtailadmin_urls
|
|
||||||
from wagtail.documents import urls as wagtaildocs_urls
|
|
||||||
|
|
||||||
from vbv_lernwelt.assignment.views import request_assignment_completion_status
|
from vbv_lernwelt.assignment.views import request_assignment_completion_status
|
||||||
from vbv_lernwelt.core.middleware.auth import django_view_authentication_exempt
|
from vbv_lernwelt.core.middleware.auth import django_view_authentication_exempt
|
||||||
|
|
@ -57,6 +54,9 @@ from vbv_lernwelt.importer.views import (
|
||||||
t2l_sync,
|
t2l_sync,
|
||||||
)
|
)
|
||||||
from vbv_lernwelt.notify.views import email_notification_settings
|
from vbv_lernwelt.notify.views import email_notification_settings
|
||||||
|
from wagtail import urls as wagtail_urls
|
||||||
|
from wagtail.admin import urls as wagtailadmin_urls
|
||||||
|
from wagtail.documents import urls as wagtaildocs_urls
|
||||||
|
|
||||||
|
|
||||||
class SignedIntConverter(IntConverter):
|
class SignedIntConverter(IntConverter):
|
||||||
|
|
|
||||||
|
|
@ -101,7 +101,7 @@ class AttendanceCourseUserMutationTestCase(GraphQLTestCase):
|
||||||
data["completion_data"],
|
data["completion_data"],
|
||||||
{
|
{
|
||||||
user_text_input["id"]: {"user_data": {"text": "Hallo via API"}},
|
user_text_input["id"]: {"user_data": {"text": "Hallo via API"}},
|
||||||
task_id: {"user_data": {"fileId": file_id}}
|
task_id: {"user_data": {"fileId": file_id}},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -109,15 +109,11 @@ class AttendanceCourseUserMutationTestCase(GraphQLTestCase):
|
||||||
self.assertDictEqual(
|
self.assertDictEqual(
|
||||||
task_data,
|
task_data,
|
||||||
{
|
{
|
||||||
"user_data":
|
"user_data": {
|
||||||
{
|
|
||||||
"fileId": file_id,
|
"fileId": file_id,
|
||||||
"fileInfo": {
|
"fileInfo": {"id": file_id, "name": "file.txt", "url": file_url},
|
||||||
"id": file_id,
|
|
||||||
"name": 'file.txt',
|
|
||||||
"url": file_url}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
# check DB data
|
# check DB data
|
||||||
|
|
@ -131,7 +127,7 @@ class AttendanceCourseUserMutationTestCase(GraphQLTestCase):
|
||||||
db_entry.completion_data,
|
db_entry.completion_data,
|
||||||
{
|
{
|
||||||
user_text_input["id"]: {"user_data": {"text": "Hallo via API"}},
|
user_text_input["id"]: {"user_data": {"text": "Hallo via API"}},
|
||||||
task_id: {"user_data": {"fileId": file_id}}
|
task_id: {"user_data": {"fileId": file_id}},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -175,7 +171,7 @@ class AttendanceCourseUserMutationTestCase(GraphQLTestCase):
|
||||||
data["completion_data"],
|
data["completion_data"],
|
||||||
{
|
{
|
||||||
user_text_input["id"]: {"user_data": {"text": "Hallo via API 2"}},
|
user_text_input["id"]: {"user_data": {"text": "Hallo via API 2"}},
|
||||||
task_id: {"user_data": {"fileId": file_id}}
|
task_id: {"user_data": {"fileId": file_id}},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -191,7 +187,7 @@ class AttendanceCourseUserMutationTestCase(GraphQLTestCase):
|
||||||
db_entry.completion_data,
|
db_entry.completion_data,
|
||||||
{
|
{
|
||||||
user_text_input["id"]: {"user_data": {"text": "Hallo via API 2"}},
|
user_text_input["id"]: {"user_data": {"text": "Hallo via API 2"}},
|
||||||
task_id: {"user_data": {"fileId": file_id}}
|
task_id: {"user_data": {"fileId": file_id}},
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ def s3_get_client():
|
||||||
credentials = s3_get_credentials()
|
credentials = s3_get_credentials()
|
||||||
|
|
||||||
# This is needed until https://github.com/boto/boto3/issues/3015 is fixed
|
# This is needed until https://github.com/boto/boto3/issues/3015 is fixed
|
||||||
s3 = boto3.client('s3', region_name=credentials.region_name)
|
s3 = boto3.client("s3", region_name=credentials.region_name)
|
||||||
endpoint_url = s3.meta.endpoint_url
|
endpoint_url = s3.meta.endpoint_url
|
||||||
|
|
||||||
return boto3.client(
|
return boto3.client(
|
||||||
|
|
@ -56,7 +56,7 @@ def s3_get_client():
|
||||||
aws_access_key_id=credentials.access_key_id,
|
aws_access_key_id=credentials.access_key_id,
|
||||||
aws_secret_access_key=credentials.secret_access_key,
|
aws_secret_access_key=credentials.secret_access_key,
|
||||||
region_name=credentials.region_name,
|
region_name=credentials.region_name,
|
||||||
endpoint_url=endpoint_url
|
endpoint_url=endpoint_url,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -104,7 +104,6 @@ def s3_generate_presigned_post(
|
||||||
["starts-with", "$Content-Disposition", ""],
|
["starts-with", "$Content-Disposition", ""],
|
||||||
],
|
],
|
||||||
ExpiresIn=expires_in,
|
ExpiresIn=expires_in,
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
return presigned_data
|
return presigned_data
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,8 @@ def presign(request):
|
||||||
service = FileDirectUploadService(request.user)
|
service = FileDirectUploadService(request.user)
|
||||||
|
|
||||||
upload_file, pre_signed_data = service.start(
|
upload_file, pre_signed_data = service.start(
|
||||||
file_name=serializer.validated_data["file_name"], file_type=serializer.validated_data["file_type"]
|
file_name=serializer.validated_data["file_name"],
|
||||||
|
file_type=serializer.validated_data["file_type"],
|
||||||
)
|
)
|
||||||
|
|
||||||
return Response(
|
return Response(
|
||||||
|
|
@ -28,6 +29,6 @@ def presign(request):
|
||||||
"id": upload_file.id,
|
"id": upload_file.id,
|
||||||
"name": upload_file.original_file_name,
|
"name": upload_file.original_file_name,
|
||||||
"url": upload_file.url,
|
"url": upload_file.url,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue