|
|
@ -1,4 +1,4 @@
|
|
|
|
from mailu import models
|
|
|
|
from mailu import models, utils
|
|
|
|
from mailu.ui import ui, forms, access
|
|
|
|
from mailu.ui import ui, forms, access
|
|
|
|
|
|
|
|
|
|
|
|
import flask
|
|
|
|
import flask
|
|
|
@ -23,6 +23,7 @@ def fetch_create(user_email):
|
|
|
|
user = models.User.query.get(user_email) or flask.abort(404)
|
|
|
|
user = models.User.query.get(user_email) or flask.abort(404)
|
|
|
|
form = forms.FetchForm()
|
|
|
|
form = forms.FetchForm()
|
|
|
|
form.password.validators = [wtforms.validators.DataRequired()]
|
|
|
|
form.password.validators = [wtforms.validators.DataRequired()]
|
|
|
|
|
|
|
|
utils.formatCSVField(form.folders)
|
|
|
|
if form.validate_on_submit():
|
|
|
|
if form.validate_on_submit():
|
|
|
|
fetch = models.Fetch(user=user)
|
|
|
|
fetch = models.Fetch(user=user)
|
|
|
|
form.populate_obj(fetch)
|
|
|
|
form.populate_obj(fetch)
|
|
|
@ -41,6 +42,7 @@ def fetch_create(user_email):
|
|
|
|
def fetch_edit(fetch_id):
|
|
|
|
def fetch_edit(fetch_id):
|
|
|
|
fetch = models.Fetch.query.get(fetch_id) or flask.abort(404)
|
|
|
|
fetch = models.Fetch.query.get(fetch_id) or flask.abort(404)
|
|
|
|
form = forms.FetchForm(obj=fetch)
|
|
|
|
form = forms.FetchForm(obj=fetch)
|
|
|
|
|
|
|
|
utils.formatCSVField(form.folders)
|
|
|
|
if form.validate_on_submit():
|
|
|
|
if form.validate_on_submit():
|
|
|
|
if not form.password.data:
|
|
|
|
if not form.password.data:
|
|
|
|
form.password.data = fetch.password
|
|
|
|
form.password.data = fetch.password
|
|
|
|