Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Adler committed Aug 19, 2024
1 parent 3d47c61 commit c04ce24
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/views/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def register():
def login():
auth_header = request.headers.get('Authorization')

# if not auth_header or not auth_header.startswith('Basic '):
# return jsonify({'message': 'Authorization header is missing or invalid'}), 401
if not auth_header or not auth_header.startswith('Basic '):
return jsonify({'message': 'Authorization header is missing or invalid'}), 401

# Decode the Basic Auth header
try:
Expand Down
5 changes: 0 additions & 5 deletions app/views/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
from mongoengine import DoesNotExist
from bson import ObjectId



import json

from app.models.item import Item
from app.models.user import User
from app.utils.auth_utils import token_required
Expand Down Expand Up @@ -48,7 +44,6 @@ def import_session(**kwargs):
for user_data in data['user']:
try:
user = User.objects.get(username=user_data['username'])
# user.items = user_data['items']
user.items = [ObjectId(item_id) for item_id in user_data['items']]
user.save()
user_count+=1
Expand Down
3 changes: 0 additions & 3 deletions tests/views/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import json
import unittest

from mongoengine import disconnect

from app import create_app
from app.models.item import Item
from app.models.user import User

Expand Down

0 comments on commit c04ce24

Please sign in to comment.