@@ -44,7 +44,7 @@ def get_user_signature():
44
44
if html_signature :
45
45
_signature = html_signature .renderContents ()
46
46
content = ""
47
- if ( cstr (_signature ) or signature ) :
47
+ if cstr (_signature ) or signature :
48
48
content = f'<br><p class="signature">{ signature } </p>'
49
49
return content
50
50
@@ -64,14 +64,16 @@ def check_app_permission():
64
64
return True
65
65
66
66
roles = frappe .get_roles ()
67
- if any (role in ["System Manager" , "Sales User" , "Sales Manager" , "Sales Master Manager" ] for role in roles ):
67
+ if any (
68
+ role in ["System Manager" , "Sales User" , "Sales Manager" , "Sales Master Manager" ] for role in roles
69
+ ):
68
70
return True
69
71
70
72
return False
71
73
72
74
73
75
@frappe .whitelist (allow_guest = True )
74
- def accept_invitation (key : str = None ):
76
+ def accept_invitation (key : str | None = None ):
75
77
if not key :
76
78
frappe .throw ("Invalid or expired key" )
77
79
@@ -91,6 +93,7 @@ def accept_invitation(key: str = None):
91
93
92
94
@frappe .whitelist ()
93
95
def invite_by_email (emails : str , role : str ):
96
+ frappe .only_for ("Sales Manager" )
94
97
if not emails :
95
98
return
96
99
email_string = validate_email_address (emails , throw = False )
@@ -120,8 +123,8 @@ def get_file_uploader_defaults(doctype: str):
120
123
make_attachments_public = meta .get ("make_attachments_public" )
121
124
122
125
return {
123
- ' allowed_file_types' : frappe .get_system_settings ("allowed_file_extensions" ),
124
- ' max_file_size' : get_max_file_size (),
125
- ' max_number_of_files' : max_number_of_files ,
126
- ' make_attachments_public' : bool (make_attachments_public ),
127
- }
126
+ " allowed_file_types" : frappe .get_system_settings ("allowed_file_extensions" ),
127
+ " max_file_size" : get_max_file_size (),
128
+ " max_number_of_files" : max_number_of_files ,
129
+ " make_attachments_public" : bool (make_attachments_public ),
130
+ }
0 commit comments