Skip to content

Commit

Permalink
broken commit, WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
caseybecking committed Nov 1, 2024
1 parent 455bc33 commit d6a07ff
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
1 change: 1 addition & 0 deletions api/institution/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ def post(self):

def get(self):
institutions = InstitutionModel.query.all()
print(institutions)
return make_response(jsonify({'institutions': institutions}), 200)
2 changes: 1 addition & 1 deletion api/institution/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, user_id, name, location, description):

def __repr__(self):
return '<Institution %r>' % self.name

def save(self):
db.session.add(self)
db.session.commit()
Expand Down
8 changes: 4 additions & 4 deletions api/user/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
'username': fields.String(required=True, description='Username'),
'password': fields.String(required=True, description='Password'),
'first_name': fields.String(required=True, description='First Name'),
'last_name': fields.String(required=True, description='Last Name'),
'api_key': fields.String(description='API Key')
})
'last_name': fields.String(required=True, description='Last Name')
})

@g.api.route('/user')
class User(Resource):
Expand Down Expand Up @@ -43,4 +42,5 @@ def post(self):

def get(self):
users = _user_model.query.all()
return make_response(jsonify({'users': users}), 200)\
return make_response(jsonify({'users': users}), 200)

7 changes: 0 additions & 7 deletions api/user/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@ class User(Base, UserMixin):
last_name = db.Column(db.String(100))
api_key = db.Column(db.String(64), unique=True, nullable=True)

def __init__(self,email,username,password,first_name,last_name):
self.email = email
self.username = username
self.password = password
self.first_name = first_name
self.last_name = last_name

def __init__(self, email, username, password, first_name, last_name):
self.email = email
self.username = username
Expand Down
8 changes: 5 additions & 3 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Baseline
from app.config import Config
from app.database import db
# Flask
from flask import Flask
from flask import g
# Flask Restx
from flask_restx import Namespace
from flask_restx import Api
from flask_login import LoginManager
# Baseline
from app.config import Config
from app.database import db

def create_app():
app = Flask(__name__)
Expand Down

0 comments on commit d6a07ff

Please sign in to comment.