add organization in initial datas
This commit is contained in:
parent
8185c280d5
commit
9b42130e0c
|
@ -4,6 +4,7 @@ os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'trustchain_idhub.settings') #
|
||||||
django.setup() # noqa
|
django.setup() # noqa
|
||||||
|
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
|
from idhub.models import Organization
|
||||||
|
|
||||||
|
|
||||||
User = get_user_model()
|
User = get_user_model()
|
||||||
|
@ -19,6 +20,11 @@ def create_users(email, password):
|
||||||
u.save()
|
u.save()
|
||||||
|
|
||||||
|
|
||||||
|
def create_organizations():
|
||||||
|
Organization.objects.create(name="ExO", url="https://verify.exo.cat")
|
||||||
|
Organization.objects.create(name="Somos Connexión", url="https://verify.somosconexion.coop")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
admin = 'admin@example.org'
|
admin = 'admin@example.org'
|
||||||
pw_admin = '1234'
|
pw_admin = '1234'
|
||||||
|
@ -26,8 +32,9 @@ def main():
|
||||||
user = 'user1@example.org'
|
user = 'user1@example.org'
|
||||||
pw_user = '1234'
|
pw_user = '1234'
|
||||||
|
|
||||||
create_admin_users(admin, pw_admin)
|
# create_admin_users(admin, pw_admin)
|
||||||
create_users(user, pw_user)
|
create_users(user, pw_user)
|
||||||
|
create_organizations()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue