Selaa lähdekoodia

Added command to disable user

version-14
Valmik Jangla 9 vuotta sitten
vanhempi
commit
0c17c5aff8
1 muutettua tiedostoa jossa 15 lisäystä ja 0 poistoa
  1. +15
    -0
      frappe/commands/site.py

+ 15
- 0
frappe/commands/site.py Näytä tiedosto

@@ -167,6 +167,20 @@ def add_system_manager(context, email, first_name, last_name, send_welcome_email
finally:
frappe.destroy()


@click.command('disable-user')
@click.argument('email')
@pass_context
def disable_user(context, email):
site = get_site(context)
with frappe.init_site(site):
frappe.connect()
user = frappe.get_doc("User", email)
user.enabled = 0
user.save(ignore_permissions=True)
frappe.db.commit()


@click.command('migrate')
@click.option('--rebuild-website', help="Rebuild webpages after migration")
@pass_context
@@ -437,5 +451,6 @@ commands = [
set_limit,
set_limits,
clear_limits,
disable_user,
_use,
]

Ladataan…
Peruuta
Tallenna