This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wtforms import fields | |
import json | |
class JSONField(fields.StringField): | |
def _value(self): | |
return json.dumps(self.data) if self.data else '' | |
def process_formdata(self, valuelist): | |
if valuelist: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@task | |
def reloadapp(sleep=5): | |
""" | |
Reloads lead-ratings app and the celery workers. | |
""" | |
supervisorctl = os.path.join(env.venv_path, 'bin', 'supervisorctl') | |
# kill all gunicorn master children, sleeping in between | |
master_pid = run('sudo %s pid app' % supervisorctl) | |
children = run('pgrep -P %s' % master_pid).split('\r\n') |