Changeset - abe72ee1c447
[Not reviewed]
default
0 1 0
Dennis Fink - 10 years ago 2015-07-09 00:10:34

use frozenset for ALLOWED_STATE_KEYS
1 file changed with 2 insertions and 6 deletions:
0 comments (0 inline, 0 general)
spaceapi/state.py
Show inline comments
 
@@ -6,18 +6,14 @@ from flask import Blueprint, jsonify, re
 

	
 
from .active import active_json, save_last_state
 
from .auth import httpauth
 

	
 
state_views = Blueprint('state', __name__)
 

	
 
ALLOWED_STATE_KEYS = {
 
    'open': bool,
 
    'lastchange': int,
 
    'trigger_person': str,
 
    'message': str
 
}
 
ALLOWED_STATE_KEYS = frozenset(('open', 'lastchange',
 
                                'trigger_person', 'message'))
 

	
 

	
 
@state_views.route('/set/<key>', methods=['POST'])
 
@httpauth.login_required
 
def set_state(key):
 

	
0 comments (0 inline, 0 general)