forked from i-dot-ai/redbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
work on getting sso working and also db creds
- Loading branch information
Showing
13 changed files
with
302 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...redbox_app/redbox_core/migrations/0070_alter_user_options_alter_user_managers_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Generated by Django 5.1.3 on 2024-11-26 14:01 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("redbox_core", "0069_alter_citation_source"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterModelOptions( | ||
name="user", | ||
options={"verbose_name": "user", "verbose_name_plural": "users"}, | ||
), | ||
migrations.AlterModelManagers( | ||
name="user", | ||
managers=[], | ||
), | ||
migrations.AlterField( | ||
model_name="user", | ||
name="email", | ||
field=models.EmailField(max_length=254, unique=True), | ||
), | ||
] |
21 changes: 21 additions & 0 deletions
21
django_app/redbox_app/redbox_core/migrations/0071_create_username_field.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Custom generated migration will need to be amended for contribution back to i.ai | ||
|
||
import redbox_app.redbox_core.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("redbox_core", "0070_alter_user_options_alter_user_managers_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="user", | ||
name="username", | ||
field=models.EmailField( | ||
max_length=254, null=True | ||
), | ||
), | ||
] |
28 changes: 28 additions & 0 deletions
28
django_app/redbox_app/redbox_core/migrations/0072_populate_username_values.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Custom generated migration will need to be amended for contribution back to i.ai | ||
|
||
import redbox_app.redbox_core.models | ||
from django.db import migrations, models | ||
|
||
|
||
# Custom generated migration will need to be amended for contribution back to i.ai | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def populate_existing_users_username(apps, schema_editor): | ||
users = redbox_app.redbox_core.models.User.objects.all() | ||
|
||
for user in users: | ||
user.username = user.email | ||
user.save(update_fields=["username"]) | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("redbox_core", "0071_create_username_field"), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(populate_existing_users_username, reverse_code=migrations.RunPython.noop), | ||
] |
79 changes: 79 additions & 0 deletions
79
...redbox_app/redbox_core/migrations/0073_alter_user_options_alter_user_managers_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Generated by Django 5.1.3 on 2024-11-27 11:09 | ||
|
||
import redbox_app.redbox_core.models | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("auth", "0012_alter_user_first_name_max_length"), | ||
("redbox_core", "0072_populate_username_values"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="user", | ||
name="username", | ||
field=models.EmailField( | ||
max_length=254, unique=True, default="default@default.com" | ||
), | ||
), | ||
migrations.AlterModelOptions( | ||
name="user", | ||
options={}, | ||
), | ||
migrations.AlterModelManagers( | ||
name="user", | ||
managers=[ | ||
("objects", redbox_app.redbox_core.models.SSOUserManager()), | ||
], | ||
), | ||
migrations.RemoveField( | ||
model_name="user", | ||
name="date_joined", | ||
), | ||
migrations.RemoveField( | ||
model_name="user", | ||
name="first_name", | ||
), | ||
migrations.RemoveField( | ||
model_name="user", | ||
name="last_name", | ||
), | ||
migrations.AlterField( | ||
model_name="user", | ||
name="groups", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
related_name="sso_user_set", | ||
to="auth.group", | ||
verbose_name="groups", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="user", | ||
name="is_active", | ||
field=models.BooleanField(default=True), | ||
), | ||
migrations.AlterField( | ||
model_name="user", | ||
name="is_staff", | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AlterField( | ||
model_name="user", | ||
name="is_superuser", | ||
field=models.BooleanField(default=False), | ||
), | ||
migrations.AlterField( | ||
model_name="user", | ||
name="user_permissions", | ||
field=models.ManyToManyField( | ||
blank=True, | ||
related_name="sso_user_set", | ||
to="auth.permission", | ||
verbose_name="user permissions", | ||
), | ||
), | ||
] |
25 changes: 25 additions & 0 deletions
25
...edbox_app/redbox_core/migrations/0074_citation_text_in_answer_user_first_name_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 5.1.3 on 2024-11-27 13:58 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
("redbox_core", "0073_alter_user_options_alter_user_managers_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="user", | ||
name="first_name", | ||
field=models.CharField(default="default", max_length=48), | ||
preserve_default=False, | ||
), | ||
migrations.AddField( | ||
model_name="user", | ||
name="last_name", | ||
field=models.CharField(default="default", max_length=48), | ||
preserve_default=False, | ||
), | ||
] |
Oops, something went wrong.