mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 19:41:11 +00:00
Python formatting
This commit is contained in:
parent
a907dfdce7
commit
822e2e1a93
2 changed files with 4 additions and 5 deletions
|
@ -145,11 +145,12 @@ class FederationViews(TestCase):
|
||||||
|
|
||||||
view = views.ImportServerBlocklist.as_view()
|
view = views.ImportServerBlocklist.as_view()
|
||||||
request = self.factory.post(
|
request = self.factory.post(
|
||||||
"", {
|
"",
|
||||||
|
{
|
||||||
"json_file": SimpleUploadedFile(
|
"json_file": SimpleUploadedFile(
|
||||||
"file.json", open("file.json", "rb").read()
|
"file.json", open("file.json", "rb").read()
|
||||||
)
|
)
|
||||||
}
|
},
|
||||||
)
|
)
|
||||||
request.user = self.local_user
|
request.user = self.local_user
|
||||||
request.user.is_superuser = True
|
request.user.is_superuser = True
|
||||||
|
|
|
@ -79,9 +79,7 @@ class ImportServerBlocklist(View):
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
""" add a server from the admin panel """
|
""" add a server from the admin panel """
|
||||||
json_data = json.load(
|
json_data = json.load(request.FILES["json_file"])
|
||||||
request.FILES["json_file"]
|
|
||||||
)
|
|
||||||
failed = []
|
failed = []
|
||||||
success_count = 0
|
success_count = 0
|
||||||
for item in json_data:
|
for item in json_data:
|
||||||
|
|
Loading…
Reference in a new issue