Example #1
0
 def setUp(self):
     db.create_all()
     a = Player('')
     a.admin = True
     db.session.add(a)
     db.session.commit()
     self.admin = a
     with self.client.session_transaction() as sess:
         sess['user_id'] = a.id
Example #2
0
def add_admin(steam_id):
    config_app(app)
    from lobbypy.utils import db
    from lobbypy.models import Player
    player = Player.query.filter_by(steam_id=steam_id).first()
    if player:
        player.admin = True
    else:
        player = Player(steam_id)
        player.admin = True
    password = prompt_pass("Enter password for the Administrator")
    if password == prompt_pass("Re-enter password for the Administrator"):
        player.password = crypt(password)
        db.session.add(player)
        db.session.commit()
    else:
        print "Passwords do not match, re-run command"
Example #3
0
def add_admin(steam_id):
    config_app(app, **config)
    from lobbypy.utils import db
    from lobbypy.models import Player
    player = Player.query.filter_by(steam_id = steam_id).first()
    if player:
        player.admin = True
    else:
        player = Player(steam_id)
        player.admin = True
    password = prompt_pass(
            "Enter password for the Administrator")
    if password == prompt_pass(
            "Re-enter password for the Administrator"):
        player.password = crypt(password)
        db.session.add(player)
        db.session.commit()
    else:
        print "Passwords do not match, re-run command"