Browse Source

user management in a different blueprint, to generate two different documentations

master
Julio Biason 11 years ago
parent
commit
fb25d485b3
  1. 6
      luncho/blueprints/groups.py
  2. 2
      luncho/server.py

6
luncho/blueprints/groups.py

@ -255,8 +255,10 @@ def delete_group(groupId):
return jsonify(status='OK') return jsonify(status='OK')
group_users = Blueprint('group_users', __name__)
@groups.route('<groupId>/users/', methods=['PUT'])
@group_users.route('<groupId>/users/', methods=['PUT'])
@ForceJSON(required=['usernames']) @ForceJSON(required=['usernames'])
@auth @auth
def add_users_to_group(groupId): def add_users_to_group(groupId):
@ -312,7 +314,7 @@ def add_users_to_group(groupId):
return jsonify(status='OK') return jsonify(status='OK')
@groups.route('<groupId>/users/', methods=['GET']) @group_users.route('<groupId>/users/', methods=['GET'])
@auth @auth
def list_group_members(groupId): def list_group_members(groupId):
"""*Authenticated request* """*Authenticated request*

2
luncho/server.py

@ -127,11 +127,13 @@ class Place(db.Model):
from blueprints.users import users from blueprints.users import users
from blueprints.token import token from blueprints.token import token
from blueprints.groups import groups from blueprints.groups import groups
from blueprints.groups import group_users
from blueprints.places import places from blueprints.places import places
app.register_blueprint(token, url_prefix='/token/') app.register_blueprint(token, url_prefix='/token/')
app.register_blueprint(users, url_prefix='/user/') app.register_blueprint(users, url_prefix='/user/')
app.register_blueprint(groups, url_prefix='/group/') app.register_blueprint(groups, url_prefix='/group/')
app.register_blueprint(group_users, url_prefix='/group/')
app.register_blueprint(places, url_prefix='/place/') app.register_blueprint(places, url_prefix='/place/')

Loading…
Cancel
Save