Skip to content

Commit 144c3e2

Browse files
committed
Remove print statements
Changes to be committed: modified: authentication/apis.py modified: authentication/services.py modified: authentication/urls.py modified: biocompute/apis.py modified: biocompute/services.py modified: config/urls.py modified: prefix/services.py modified: tests/test_apis/test_biocompute/test_objects_drafts_publish.py
1 parent 89bc8e2 commit 144c3e2

File tree

8 files changed

+7
-10
lines changed

8 files changed

+7
-10
lines changed

authentication/apis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def post(self, request):
356356
username=request.user,
357357
auth_service=[request.data]
358358
)
359-
print('status=status.HTTP_201_CREATED')
359+
360360
return Response(
361361
status=status.HTTP_201_CREATED,
362362
data={"message": "Authentication object created and added to account"}
@@ -528,7 +528,7 @@ def post(self, request):
528528
Returns:
529529
Response: A HTTP response indicating the result of the registration attempt.
530530
"""
531-
print("FIRST LINE")
531+
532532
user_info = self.InputSerializer(data=request.data)
533533
user_info.is_valid(raise_exception=True)
534534
token = user_info.validated_data['token']

authentication/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ def authenticate_orcid(payload:dict, token:str)-> User:
159159
try:
160160
jwt.decode(token, key=orcid_key, algorithms=['RS256'], audience=['APP-88DEA42BRILGEHKC', 'APP-ZQZ0BL62NV9SBWAX'])
161161
except Exception as exp:
162-
print('exp:', exp)
163162
raise exceptions.AuthenticationFailed(exp)
163+
164164
try:
165165
user = User.objects.get(username=Authentication.objects.get(auth_service__icontains=payload['sub']).username)
166166
except (Authentication.DoesNotExist, User.DoesNotExist):

authentication/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# authentication/urls.py
22

33
from django.urls import path
4+
from rest_framework_jwt.views import obtain_jwt_token, verify_jwt_token
45
from authentication.apis import (
56
NewAccountApi,
67
AccountActivateApi,
@@ -12,6 +13,8 @@
1213
)
1314

1415
urlpatterns = [
16+
# path("token/", obtain_jwt_token),
17+
# path("verify/", verify_jwt_token),
1518
path(
1619
"accounts/activate/<str:email>/<str:temp_identifier>",
1720
AccountActivateApi.as_view(),

biocompute/apis.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,6 @@ def post(self, request) -> Response:
425425
]
426426
)
427427
for index, object in enumerate(data):
428-
print(index, object.keys())
429428
response_id = object.get("object_id", index)
430429
modify_permitted = user_can_modify_bco(response_id, requester)
431430

biocompute/services.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ def check_etag_validity(bco_contents: dict) -> bool:
541541
bco_contents_copy.pop(key, None)
542542

543543
regenerated_etag = sha256(json.dumps(bco_contents_copy).encode('utf-8')).hexdigest()
544-
print(provided_etag, regenerated_etag)
544+
545545
return provided_etag == regenerated_etag
546546

547547
@transaction.atomic

config/urls.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from drf_yasg.views import get_schema_view
1010
from drf_yasg import openapi
1111
from rest_framework import permissions
12-
from rest_framework_jwt.views import obtain_jwt_token, verify_jwt_token
1312
from biocompute.apis import DraftRetrieveApi, PublishedRetrieveApi
1413

1514
VERSION = settings.VERSION
@@ -46,8 +45,6 @@
4645
name="schema-redoc",
4746
),
4847
path("api/admin/", admin.site.urls),
49-
path("api/token/", obtain_jwt_token),
50-
path("api/verify/", verify_jwt_token),
5148
path("api/", include("authentication.urls")),
5249
path("api/", include("search.urls")),
5350
path("api/", include("biocompute.urls")),

prefix/services.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ def delete_prefix(prefix_name: str, user: User) -> bool:
279279
for perm in ["add", "change", "publish"]:
280280
try:
281281
Permission.objects.get(codename=f"{perm}_{prefix_name}").delete()
282-
print(f"{perm}_{prefix_name}")
283282
except Permission.DoesNotExist:
284283
pass
285284
return True

tests/test_apis/test_biocompute/test_objects_drafts_publish.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ def test_successful_publish(self):
7171

7272
self.client.credentials(HTTP_AUTHORIZATION='Token ' + self.token.key)
7373
response = self.client.post('/api/objects/drafts/publish/', self.data, format='json')
74-
print(response.data)
7574
self.assertEqual(response.status_code, 200)
7675

7776
def test_partial_failure(self):

0 commit comments

Comments
 (0)