Fix migration conflict with password-reset leaves
Renumber OAuthIdentity to 0026 after 0025_outbound_email (master already shipped 0024_user_auth_event), and restore missing ResetUserPassword import.
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
# Generated by Django 6.0 on 2026-07-27 11:51
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('chat_backend', '0023_promptmetric_tokens_in_promptmetric_tokens_out'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='OAuthIdentity',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('created', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('last_modified', models.DateTimeField(default=django.utils.timezone.now)),
|
||||
('provider', models.CharField(choices=[('google', 'Google'), ('microsoft', 'Microsoft')], max_length=32)),
|
||||
('subject', models.CharField(help_text='OIDC subject (sub) from the identity provider', max_length=255)),
|
||||
('email', models.EmailField(blank=True, default='', max_length=254)),
|
||||
('access_token', models.TextField(blank=True, default='')),
|
||||
('refresh_token', models.TextField(blank=True, default='')),
|
||||
('token_expires_at', models.DateTimeField(blank=True, null=True)),
|
||||
('scopes', models.TextField(blank=True, default='')),
|
||||
('raw_profile', models.JSONField(blank=True, default=dict)),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='oauth_identities', to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
options={
|
||||
'verbose_name_plural': 'OAuth identities',
|
||||
'constraints': [models.UniqueConstraint(fields=('provider', 'subject'), name='uniq_oauth_provider_subject'), models.UniqueConstraint(fields=('provider', 'user'), name='uniq_oauth_provider_user')],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,75 @@
|
||||
# Generated by Django 6.0 on 2026-07-27 11:51
|
||||
|
||||
import django.db.models.deletion
|
||||
import django.utils.timezone
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("chat_backend", "0025_outbound_email"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="OAuthIdentity",
|
||||
fields=[
|
||||
(
|
||||
"id",
|
||||
models.BigAutoField(
|
||||
auto_created=True,
|
||||
primary_key=True,
|
||||
serialize=False,
|
||||
verbose_name="ID",
|
||||
),
|
||||
),
|
||||
("created", models.DateTimeField(default=django.utils.timezone.now)),
|
||||
(
|
||||
"last_modified",
|
||||
models.DateTimeField(default=django.utils.timezone.now),
|
||||
),
|
||||
(
|
||||
"provider",
|
||||
models.CharField(
|
||||
choices=[("google", "Google"), ("microsoft", "Microsoft")],
|
||||
max_length=32,
|
||||
),
|
||||
),
|
||||
(
|
||||
"subject",
|
||||
models.CharField(
|
||||
help_text="OIDC subject (sub) from the identity provider",
|
||||
max_length=255,
|
||||
),
|
||||
),
|
||||
("email", models.EmailField(blank=True, default="", max_length=254)),
|
||||
("access_token", models.TextField(blank=True, default="")),
|
||||
("refresh_token", models.TextField(blank=True, default="")),
|
||||
("token_expires_at", models.DateTimeField(blank=True, null=True)),
|
||||
("scopes", models.TextField(blank=True, default="")),
|
||||
("raw_profile", models.JSONField(blank=True, default=dict)),
|
||||
(
|
||||
"user",
|
||||
models.ForeignKey(
|
||||
on_delete=django.db.models.deletion.CASCADE,
|
||||
related_name="oauth_identities",
|
||||
to=settings.AUTH_USER_MODEL,
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"verbose_name_plural": "OAuth identities",
|
||||
"constraints": [
|
||||
models.UniqueConstraint(
|
||||
fields=("provider", "subject"),
|
||||
name="uniq_oauth_provider_subject",
|
||||
),
|
||||
models.UniqueConstraint(
|
||||
fields=("provider", "user"), name="uniq_oauth_provider_user"
|
||||
),
|
||||
],
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -15,6 +15,7 @@ from .views import (
|
||||
ConversationDetailView,
|
||||
CompanyUsersView,
|
||||
SetUserPassword,
|
||||
ResetUserPassword,
|
||||
ConversationPreferences,
|
||||
UserPromptAnalytics,
|
||||
UserConversationAnalytics,
|
||||
|
||||
Reference in New Issue
Block a user