updates the ghuser on login
This commit is contained in:
parent
603c29c8b4
commit
055e10b97e
9 changed files with 166 additions and 62 deletions
1
githubnetwork/management/commands/__init__.py
Normal file
1
githubnetwork/management/commands/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
# -*- coding: utf-8 -*-
|
8
githubnetwork/management/commands/make_admin.py
Normal file
8
githubnetwork/management/commands/make_admin.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
def handle(self, username, **option):
|
||||
User.objects.filter(username=username).update(is_staff=True, is_superuser=True)
|
8
githubnetwork/management/commands/revoke_admin.py
Normal file
8
githubnetwork/management/commands/revoke_admin.py
Normal file
|
@ -0,0 +1,8 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.management.base import BaseCommand
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
def handle(self, username, **option):
|
||||
User.objects.filter(username=username).update(is_staff=False, is_superuser=False)
|
Loading…
Add table
Add a link
Reference in a new issue