def edit_failure(request=request): #Check response for referrer and return redirect page #We want to send user back to the page they got here from to retry try: errcode = int(request.args.get('code')) errstr = inventory_viewer.err_registry[errcode].message except: if inventory_live_data.get_lockout_state(): errcode = 16 errstr = inventory_viewer.err_registry[errcode].message else: errcode = -1 errstr = "Undefined" linv.log_dest.error("Returning fail page " + errstr) new_url = str(request.referrer) url_info = ih.parse_edit_url(new_url) bread = [['⌂', url_for('index')], [url_pref.strip('/'), url_for('inventory_app.show_edit_root')]] mess = "Error " + str(errcode) + ": (" + str(dt.now().strftime( '%d/%m/%y %H:%M:%S')) + ") " + errstr + " for " + url_info[ 'db_name'] + "." + url_info['collection_name'] return render_template('edit_failure.html', new_url=new_url, message=mess, submit_contact=linv.email_contact, bread=bread)
def edit_success(request=request): #Check response for referrer and return redirect page #We want to send user back to the parent of the page they got here from referrer = str(request.referrer) url_info = ih.parse_edit_url(referrer) if not url_info['parent']: new_url = url_for('inventory_app.show_edit_root') else: new_url = url_info['parent'] #print url_info, new_url bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')]] return render_template('edit_success.html', new_url=new_url, db_name=url_info['db_name'], table_name=url_info['table_name'], bread=bread)
def edit_success(request=request): #Check response for referrer and return redirect page #We want to send user back to the parent of the page they got here from referrer = str(request.referrer) url_info = ih.parse_edit_url(referrer) if not url_info['parent']: new_url = url_for('inventory_app.show_edit_root') else: new_url = url_info['parent'] #print url_info, new_url bread = [['⌂', url_for('index')], [url_pref.strip('/'), url_for('inventory_app.show_edit_root')]] return render_template('edit_success.html', new_url=new_url, db_name=url_info['db_name'], collection_name=url_info['collection_name'], bread=bread)
def edit_failure(request=request): #Check response for referrer and return redirect page #We want to send user back to the page they got here from to retry try: errcode = int(request.args.get('code')) errstr = inventory_viewer.err_registry[errcode].message except: if inventory_live_data.get_lockout_state(): errcode = 16 errstr = inventory_viewer.err_registry[errcode].message else: errcode = -1 errstr = "Undefined" linv.log_dest.error("Returning fail page "+ errstr) new_url = str(request.referrer) url_info = ih.parse_edit_url(new_url) bread=[['⌂', url_for('index')],[url_pref.strip('/'), url_for('inventory_app.show_edit_root')]] mess = "Error "+str(errcode)+": ("+str(dt.now().strftime('%d/%m/%y %H:%M:%S'))+") "+errstr+" for "+url_info['db_name']+"."+url_info['table_name'] return render_template('edit_failure.html', new_url=new_url, message = mess, submit_contact=linv.email_contact, bread=bread)