Merge branch 'master' of github.com:webnotes/wnframework

This commit is contained in:
Rushabh Mehta 2011-08-11 16:34:22 +05:30
commit cff82cd226
4 changed files with 12 additions and 6 deletions

View file

@ -358,7 +358,7 @@ class DbManager:
mysql = mysql_path and os.path.join(mysql_path, 'mysql') or 'mysql'
try:
ret = os.system("%s -u root -p%s %s < %s"%(mysql, root_password.replace(" ", "\ "), target, source))
ret = os.system("%s -u root -p%s %s < %s"%(mysql, root_password.replace(" ", "\ "), target.replace("$", "\$"), source))
except Exception,e:
raise e

View file

@ -150,10 +150,16 @@ class Profile:
# get profile
profile = webnotes.conn.sql("SELECT name, email, first_name, last_name FROM tabProfile WHERE name=%s OR email=%s",(self.name, self.name))
profile_cols = [desc[0] for desc in webnotes.conn.sql("DESCRIBE tabProfile")]
if not profile:
raise Exception, "Profile %s not found" % self.name
elif 'registered' in profile_cols:
if not webnotes.conn.sql("SELECT registered FROM tabProfile WHERE name=%s", self.name)[0][0]:
# if an unregistered user tries to reset password
raise Exception, "You cannot reset your password as you have not completed registration. You need to complete registration using the link provided in the email."
# update tab Profile
webnotes.conn.sql("UPDATE tabProfile SET password=password(%s) WHERE name=%s", (pwd, profile[0][0]))

View file

@ -181,7 +181,7 @@ _f.Frm.prototype.savedoc=function(save_action,onsave,onerr){this.error_in_sectio
_f.Frm.prototype.saveupdate=function(){this.save('Update');}
_f.Frm.prototype.savesubmit=function(){var answer=confirm("Permanently Submit "+this.docname+"?");if(answer)this.save('Submit');}
_f.Frm.prototype.savecancel=function(){var answer=confirm("Permanently Cancel "+this.docname+"?");if(answer)this.save('Cancel');}
_f.Frm.prototype.savetrash=function(){var me=this;var answer=confirm("Permanently Delete "+this.docname+"? This action cannot be reversed");if(answer){$c('webnotes.model.delete_doc',{dt:this.doctype,dn:this.docname},function(r,rt){if(r.message=='okay'){delete locals[me.doctype][me.docname];if(page_body.wntoolbar)page_body.wntoolbar.rdocs.remove(me.doctype,me.docname);nav_obj.show_last_open();}})}}
_f.Frm.prototype.savetrash=function(){var me=this;var answer=confirm("Permanently Delete "+this.docname+"? This action cannot be reversed");if(answer){$c('webnotes.model.delete_doc',{dt:this.doctype,dn:this.docname},function(r,rt){if(r.message=='okay'){LocalDB.delete_doc(me.doctype,me.docname);if(page_body.wntoolbar)page_body.wntoolbar.rdocs.remove(me.doctype,me.docname);nav_obj.show_last_open();}})}}
_f.Frm.prototype.amend_doc=function(){if(!this.fields_dict['amended_from']){alert('"amended_from" field must be present to do an amendment.');return;}
var me=this;var fn=function(newdoc){newdoc.amended_from=me.docname;if(me.fields_dict&&me.fields_dict['amendment_date'])
newdoc.amendment_date=dateutil.obj_to_str(new Date());}
@ -495,4 +495,4 @@ wn.widgets.form.file_upload_done=function(doctype,docname,fileid,filename,at_id,
fl.push(filename+','+fileid)
doc.file_list=fl.join('\n');}
else
doc.file_list=filename+','+fileid;doc.modified=new_timestamp;var frm=frms[doctype];frm.attachments.dialog.hide();msgprint('File Uploaded Sucessfully.');frm.refresh();}
doc.file_list=filename+','+fileid;doc.modified=new_timestamp;var frm=frms[doctype];frm.attachments.dialog.hide();msgprint('File Uploaded Sucessfully.');frm.refresh();}

View file

@ -1118,7 +1118,7 @@ _f.Frm.prototype.savetrash = function() {
$c('webnotes.model.delete_doc', {dt:this.doctype, dn:this.docname}, function(r,rt) {
if(r.message=='okay') {
// delete from locals
delete locals[me.doctype][me.docname];
LocalDB.delete_doc(me.doctype, me.docname);
// delete from recent
if(page_body.wntoolbar) page_body.wntoolbar.rdocs.remove(me.doctype, me.docname);