Example #1
0
def get_Data():

  if 'email' not in session:
    return redirect(url_for('home'))

  scraper = ScraperForm()
  scraper.set_supervisor_choices()
  form = SupervisorForm()

  if scraper.is_submitted():
    if scraper.validate() == False:
      flash('To get supervisor data, pick a name')
      return render_template('create_supervisor.html', scraper=scraper, form=form)
    else:
      scraperInfo = Scraper()
      scraperInfo.getInformation(scraper.supervisorName.data)
      form.insertScraperInfo(scraperInfo)
      flash('Information found shown in form below')
      return render_template('create_supervisor.html', scraper=scraper, form=form)
  return render_template('create_supervisor.html', scraper=scraper, form=form)