Skip to content

Instantly share code, notes, and snippets.

@rmehta
Created September 9, 2016 08:29
Show Gist options
  • Save rmehta/85129c7ca95a32e67c6c26316649d088 to your computer and use it in GitHub Desktop.
Save rmehta/85129c7ca95a32e67c6c26316649d088 to your computer and use it in GitHub Desktop.
- simultaneous_sessions = frappe.db.get_value('User', user, 'simultaneous_sessions') or 1
+ limit = 0
+ if user==frappe.session.user:
+ # logging out self
+ # keep my other sessions active
+ simultaneous_sessions = frappe.db.get_value('User', user, 'simultaneous_sessions') or 1
+ limit = simultaneous_sessions - 1
condition = ''
if keep_current:
condition = ' and sid != "{0}"'.format(frappe.session.sid)
- limit = simultaneous_sessions - 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment