Merge branch 'master' of github.com:ZeusWPI/Foodbot

This commit is contained in:
Feliciaan De Palmenaer 2015-03-31 19:24:07 +02:00
commit d4f129cd35
8 changed files with 10 additions and 16 deletions

View file

@ -24,5 +24,6 @@ class PrefixFix(object):
environ['PATH_INFO'] = path[len(self.script_name):]
return self.app(environ, start_response)
if not app.debug:
app.wsgi_app = PrefixFix(app.wsgi_app, '/james')

View file

@ -1,6 +1,5 @@
# config
class Configuration(object):
SQLALCHEMY_DATABASE_URI = 'sqlite:///james.db'
DEBUG = True

View file

@ -37,6 +37,7 @@ def chinees_create_entry(zetmeel, vlees="", saus=""):
entry.configure(chinees, "{} {} {}".format(zetmeel, vlees, saus).rstrip(), 550)
db.session.add(entry)
for zetmeel, vlees, saus in product(zetmelen, vlezen, sauzen):
chinees_create_entry(zetmeel, vlees, saus)

View file

@ -35,6 +35,7 @@ class OrderItemForm(Form):
def populate(self, location):
self.product_id.choices = [(i.id, (i.name + ": " + euro(i.price))) for i in location.products]
class AnonOrderItemForm(OrderItemForm):
name = StringField('Name', validators=[validators.required()])
@ -43,6 +44,7 @@ class AnonOrderItemForm(OrderItemForm):
if self.name.data is None:
self.name.data = session.get('anon_name', None)
def validate(self):
rv = OrderForm.validate(self)
if not rv:

View file

@ -1,8 +1,3 @@
# TEMPORARY ## SHOULD BE DELETED AFTER KELDER.ZEUS HAS THEIR CERTIFICATE
import os
os.environ["OAUTHLIB_INSECURE_TRANSPORT"] = "1"
from views import *
from app import app, db
@ -15,7 +10,5 @@ from utils import *
from views import *
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80)

View file

@ -14,6 +14,7 @@ login_manager.init_app(app)
def load_user(userid):
return User.query.filter_by(id=userid).first()
@app.route('/login')
def login():
return zeus_login()

View file

@ -15,7 +15,7 @@ zeus = oauth.remote_app(
consumer_key=app.config['ZEUS_KEY'],
consumer_secret=app.config['ZEUS_SECRET'],
request_token_params={},
base_url='http://kelder.zeus.ugent.be/oauth/api/',
base_url='https://kelder.zeus.ugent.be/oauth/api/',
access_token_method='POST',
access_token_url='https://kelder.zeus.ugent.be/oauth/oauth2/token/',
authorize_url='https://kelder.zeus.ugent.be/oauth/oauth2/authorize/'

View file

@ -1,17 +1,14 @@
# mysite_uwsgi.ini file
[uwsgi]
plugins = python
# Django-related settings
# the base directory (full path)
chdir = /home/james/production
# Django's wsgi file
module = app.wsgi
# Callables
module = app
callable = app
# the virtualenv (full path)
home = /home/james/production/env
# something about ImportError
no-site = true
virtualenv = /home/james/production/env
# process-related settings
# master