Skip to content

Fix: Extra DB migration file is created #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ htmlcov/
*.aux
*.log
*.toc
*.egg-info
*.mo
*~
.ropeproject
Expand Down
Empty file added app/README.md
Empty file.
2 changes: 1 addition & 1 deletion app/eventyay/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.1"
__version__ = '0.1'
2 changes: 1 addition & 1 deletion app/eventyay/agenda/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class AgendaConfig(AppConfig):
name = "eventyay.agenda"
name = 'eventyay.agenda'

def ready(self):
from .phrases import AgendaPhrases # noqa
Expand Down
14 changes: 7 additions & 7 deletions app/eventyay/agenda/phrases.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from eventyay.common.text.phrases import Phrases


class AgendaPhrases(Phrases, app="agenda"):
class AgendaPhrases(Phrases, app='agenda'):
feedback_success = [
_("Thank you for your feedback!"),
_("Thanks, we (and our speakers) appreciate your feedback!"),
_('Thank you for your feedback!'),
_('Thanks, we (and our speakers) appreciate your feedback!'),
]
schedule_do_not_record = _("This session will not be recorded.")
schedule_do_not_record = _('This session will not be recorded.')

view_schedule = _("View conference schedule")
view_schedule_preview = _("View schedule preview")
view_own_submissions = _("Edit or view your proposals")
view_schedule = _('View conference schedule')
view_schedule_preview = _('View schedule preview')
view_own_submissions = _('Edit or view your proposals')
16 changes: 6 additions & 10 deletions app/eventyay/agenda/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,22 @@
LOGGER = logging.getLogger(__name__)


@app.task(name="pretalx.agenda.export_schedule_html")
@app.task(name='pretalx.agenda.export_schedule_html')
def export_schedule_html(*, event_id: int, make_zip=True):
from django.core.management import call_command

with scopes_disabled():
event = (
Event.objects.prefetch_related("submissions").filter(pk=event_id).first()
)
event = Event.objects.prefetch_related('submissions').filter(pk=event_id).first()
if not event:
LOGGER.error(f"Could not find Event ID {event_id} for export.")
LOGGER.error(f'Could not find Event ID {event_id} for export.')
return

with scope(event=event):
if not event.current_schedule:
LOGGER.error(
f"Event {event.slug} could not be exported: it has no schedule."
)
LOGGER.error(f'Event {event.slug} could not be exported: it has no schedule.')
return

cmd = ["export_schedule_html", event.slug]
cmd = ['export_schedule_html', event.slug]
if make_zip:
cmd.append("--zip")
cmd.append('--zip')
call_command(*cmd)
1 change: 0 additions & 1 deletion app/eventyay/api/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

class EventyayApiConfig(AppConfig):
name = 'eventyay.api'
label = 'eventyayapi'

def ready(self):
from . import signals, webhooks # noqa
Expand Down
177 changes: 155 additions & 22 deletions app/eventyay/api/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 5.1.9 on 2025-08-07 13:13
# Generated by Django 5.1.9 on 2025-08-19 04:32

import oauth2_provider.generators
import oauth2_provider.models
Expand All @@ -8,11 +8,9 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
]
dependencies = []

operations = [
migrations.CreateModel(
Expand All @@ -33,19 +31,94 @@ class Migration(migrations.Migration):
name='OAuthApplication',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('client_type', models.CharField(choices=[('confidential', 'Confidential'), ('public', 'Public')], max_length=32)),
('authorization_grant_type', models.CharField(choices=[('authorization-code', 'Authorization code'), ('implicit', 'Implicit'), ('password', 'Resource owner password-based'), ('client-credentials', 'Client credentials'), ('openid-hybrid', 'OpenID connect hybrid')], max_length=32)),
(
'client_type',
models.CharField(
choices=[
('confidential', 'Confidential'),
('public', 'Public'),
],
max_length=32,
),
),
(
'authorization_grant_type',
models.CharField(
choices=[
('authorization-code', 'Authorization code'),
('implicit', 'Implicit'),
('password', 'Resource owner password-based'),
('client-credentials', 'Client credentials'),
('openid-hybrid', 'OpenID connect hybrid'),
],
max_length=32,
),
),
('hash_client_secret', models.BooleanField(default=True)),
('skip_authorization', models.BooleanField(default=False)),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)),
('algorithm', models.CharField(blank=True, choices=[('', 'No OIDC support'), ('RS256', 'RSA with SHA-2 256'), ('HS256', 'HMAC with SHA-2 256')], default='', max_length=5)),
('allowed_origins', models.TextField(blank=True, default='', help_text='Allowed origins list to enable CORS, space separated')),
('name', models.CharField(max_length=255, verbose_name='Application name')),
('redirect_uris', models.TextField(help_text='Allowed URIs list, space separated', validators=[oauth2_provider.validators.URIValidator], verbose_name='Redirection URIs')),
('post_logout_redirect_uris', models.TextField(blank=True, default='', help_text='Allowed list with space separated', validators=[oauth2_provider.validators.URIValidator])),
('client_id', models.CharField(db_index=True, default=oauth2_provider.generators.generate_client_id, max_length=100, unique=True, verbose_name='Client ID')),
('client_secret', oauth2_provider.models.ClientSecretField(db_index=True, default=oauth2_provider.generators.generate_client_secret, max_length=255, verbose_name='Client secret')),
(
'algorithm',
models.CharField(
blank=True,
choices=[
('', 'No OIDC support'),
('RS256', 'RSA with SHA-2 256'),
('HS256', 'HMAC with SHA-2 256'),
],
default='',
max_length=5,
),
),
(
'allowed_origins',
models.TextField(
blank=True,
default='',
help_text='Allowed origins list to enable CORS, space separated',
),
),
(
'name',
models.CharField(max_length=255, verbose_name='Application name'),
),
(
'redirect_uris',
models.TextField(
help_text='Allowed URIs list, space separated',
validators=[oauth2_provider.validators.URIValidator],
verbose_name='Redirection URIs',
),
),
(
'post_logout_redirect_uris',
models.TextField(
blank=True,
default='',
help_text='Allowed list with space separated',
validators=[oauth2_provider.validators.URIValidator],
),
),
(
'client_id',
models.CharField(
db_index=True,
default=oauth2_provider.generators.generate_client_id,
max_length=100,
unique=True,
verbose_name='Client ID',
),
),
(
'client_secret',
oauth2_provider.models.ClientSecretField(
db_index=True,
default=oauth2_provider.generators.generate_client_secret,
max_length=255,
verbose_name='Client secret',
),
),
('active', models.BooleanField(default=True)),
],
options={
Expand All @@ -61,8 +134,19 @@ class Migration(migrations.Migration):
('scope', models.TextField(blank=True)),
('created', models.DateTimeField(auto_now_add=True)),
('updated', models.DateTimeField(auto_now=True)),
('code_challenge', models.CharField(blank=True, default='', max_length=128)),
('code_challenge_method', models.CharField(blank=True, choices=[('plain', 'plain'), ('S256', 'S256')], default='', max_length=10)),
(
'code_challenge',
models.CharField(blank=True, default='', max_length=128),
),
(
'code_challenge_method',
models.CharField(
blank=True,
choices=[('plain', 'plain'), ('S256', 'S256')],
default='',
max_length=10,
),
),
('nonce', models.CharField(blank=True, default='', max_length=255)),
('claims', models.TextField(blank=True)),
('redirect_uri', models.CharField(max_length=2500)),
Expand All @@ -75,7 +159,15 @@ class Migration(migrations.Migration):
name='OAuthIDToken',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('jti', models.UUIDField(default=uuid.uuid4, editable=False, unique=True, verbose_name='JWT Token ID')),
(
'jti',
models.UUIDField(
default=uuid.uuid4,
editable=False,
unique=True,
verbose_name='JWT Token ID',
),
),
('expires', models.DateTimeField()),
('scope', models.TextField(blank=True)),
('created', models.DateTimeField(auto_now_add=True)),
Expand All @@ -101,10 +193,27 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='WebHook',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('enabled', models.BooleanField(default=True, verbose_name='Enable webhook')),
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
(
'enabled',
models.BooleanField(default=True, verbose_name='Enable webhook'),
),
('target_url', models.URLField(verbose_name='Target URL')),
('all_events', models.BooleanField(default=True, verbose_name='All events (including newly created ones)')),
(
'all_events',
models.BooleanField(
default=True,
verbose_name='All events (including newly created ones)',
),
),
],
options={
'ordering': ('id',),
Expand All @@ -113,7 +222,15 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='WebHookCall',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('datetime', models.DateTimeField(auto_now_add=True)),
('target_url', models.URLField()),
('action_type', models.CharField(max_length=255)),
Expand All @@ -131,7 +248,15 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='WebHookEventListener',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('action_type', models.CharField(max_length=255)),
],
options={
Expand All @@ -141,7 +266,15 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='ApiCall',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
(
'id',
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name='ID',
),
),
('idempotency_key', models.CharField(db_index=True, max_length=190)),
('auth_hash', models.CharField(db_index=True, max_length=190)),
('created', models.DateTimeField(auto_now_add=True)),
Expand Down
Loading