support ticket: updated signature, doctype: create py if not exists

This commit is contained in:
Rushabh Mehta 2012-11-28 10:47:50 +05:30
parent e6634bb33e
commit 2e5afbcd7a
2 changed files with 15 additions and 2 deletions

View file

@ -103,6 +103,18 @@ class DocType:
def import_doc(self):
from webnotes.modules.import_module import import_from_files
import_from_files(record_list=[[self.doc.module, 'doctype', self.doc.name]])
def make_controller_template(self):
from webnotes.modules import get_doc_path, get_module_path, scrub
pypath = os.path.join(get_doc_path(self.doc.module,
self.doc.doctype, self.doc.name), scrub(self.doc.name) + '.py')
if not os.path.exists(pypath):
with open(pypath, 'w') as pyfile:
with open(os.path.join(get_module_path("core"), "doctype", "doctype",
"doctype_template.py"), 'r') as srcfile:
pyfile.write(srcfile.read())
def make_file_list(self):
"""

View file

@ -206,17 +206,18 @@ class Profile:
Return a dictionary of user properites to be stored in the session
"""
t = webnotes.conn.sql("""select email, first_name, last_name,
recent_documents from tabProfile where name = %s""", self.name)[0]
recent_documents, email_signature from tabProfile where name = %s""", self.name)[0]
if not self.can_read:
self.build_permissions()
d = {}
d = webnotes.DictObj({})
d['name'] = self.name
d['email'] = t[0] or ''
d['first_name'] = t[1] or ''
d['last_name'] = t[2] or ''
d['recent'] = t[3] or ''
d.email_signature = t[4]
d['hide_tips'] = self.get_hide_tips()