Skip to content

Commit 0e787fe

Browse files
move api app (#1335)
Co-authored-by: Mario Behling <mb@mariobehling.de>
1 parent b6deb48 commit 0e787fe

38 files changed

+356
-327
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from drf_spectacular.types import OpenApiTypes
22
from drf_spectacular.utils import OpenApiParameter
33

4-
from pretalx.mail.models import MailTemplateRoles
4+
from eventyay.base.models.mail import MailTemplateRoles
55

66

77
def build_expand_docs(*params):
@@ -58,7 +58,7 @@ def postprocess_schema(result, generator, request, public):
5858
{
5959
"name": "teams",
6060
"description": (
61-
"Access permissions for events are organised in teams within an organiser. "
61+
"Access permissions for events are organised in teams within an organizer. "
6262
"This is the only API endpoint that does not use the event setting on your access token, as teams exist outside the event structure."
6363
),
6464
},
@@ -78,14 +78,14 @@ def postprocess_schema(result, generator, request, public):
7878
},
7979
{
8080
"name": "speakers",
81-
"description": "Speakers can currently only updated, not created or deleted, as a speaker refers to a user object, and users can only be deleted by administrators. Organisers will see additional fields in the API, in line with the response to the update actions.",
81+
"description": "Speakers can currently only updated, not created or deleted, as a speaker refers to a user object, and users can only be deleted by administrators. organizers will see additional fields in the API, in line with the response to the update actions.",
8282
},
8383
{
8484
"name": "schedules",
8585
"description": (
8686
"In pretalx, an event’s schedule is versioned, and each version is a schedule object in the API. "
8787
"In addition to the normal ID based routing, you can use the `latest` shortcut to see the current public schedule, "
88-
"and as organiser, the `wip` shortcut will show the current unpublished working copy. "
88+
"and as organizer, the `wip` shortcut will show the current unpublished working copy. "
8989
"As retrieving the fully expanded endpoint is expensive on the pretalx side, "
9090
"consider using the redirect offered at ``by-version/?version=latest`` to check for a new release."
9191
),
@@ -100,7 +100,7 @@ def postprocess_schema(result, generator, request, public):
100100
},
101101
{
102102
"name": "rooms",
103-
"description": "Rooms are part of conference schedules. Only once the conference schedule is public will the rooms API be available to unauthenticated users. Authenticated organisers will see additional fields in the API, in line with the create and update actions.",
103+
"description": "Rooms are part of conference schedules. Only once the conference schedule is public will the rooms API be available to unauthenticated users. Authenticated organizers will see additional fields in the API, in line with the create and update actions.",
104104
},
105105
{
106106
"name": "submission-types",
@@ -112,7 +112,7 @@ def postprocess_schema(result, generator, request, public):
112112
},
113113
{
114114
"name": "tags",
115-
"description": "Tags are currently only used in the organiser backend and not publicly. As such, all tag endpoints require authentication.",
115+
"description": "Tags are currently only used in the organizer backend and not publicly. As such, all tag endpoints require authentication.",
116116
"externalDocs": {
117117
"url": "https://docs.pretalx.org/user/sessions/#tags",
118118
"description": "User documentation",
@@ -129,7 +129,7 @@ def postprocess_schema(result, generator, request, public):
129129
{
130130
"name": "questions",
131131
"description": (
132-
"The questions resource represents all fields created by organisers via the flexible “custom fields” model, "
132+
"The questions resource represents all fields created by organizers via the flexible “custom fields” model, "
133133
"with the answers available under the ``/answers/`` endpoint."
134134
),
135135
},
@@ -142,7 +142,7 @@ def postprocess_schema(result, generator, request, public):
142142
{
143143
"name": "answers",
144144
"description": (
145-
"The answers resource represents all data collected by organisers via the flexible “custom fields” model, which "
145+
"The answers resource represents all data collected by organizers via the flexible “custom fields” model, which "
146146
"allows for nearly arbitrary data collection from speakers or reviewers. "
147147
),
148148
},
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import django_filters
22
from django_scopes import scopes_disabled
33

4-
from pretalx.person.models import User
5-
from pretalx.submission.models import Review, Submission
4+
from eventyay.base.models.auth import User
5+
from eventyay.base.models.submission import Submission
6+
from eventyay.base.models.review import Review
67

78
with scopes_disabled():
89

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import django_filters
22
from django_scopes import scopes_disabled
33

4-
from pretalx.person.models import User
5-
from pretalx.schedule.models import Room, Schedule, TalkSlot
6-
from pretalx.submission.models import Submission
4+
from eventyay.base.models.auth import User
5+
from eventyay.base.models.schedule import Schedule
6+
from eventyay.base.models.slot import TalkSlot
7+
from eventyay.base.models.room import Room
8+
from eventyay.base.models.submission import Submission
79

810
with scopes_disabled():
911

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from rest_framework import exceptions
88
from rest_framework.serializers import ModelSerializer
99

10-
from pretalx.api.versions import get_api_version_from_request, get_serializer_by_version
10+
from eventyay.api.versions import get_api_version_from_request, get_serializer_by_version
1111

1212

1313
class ApiVersionException(exceptions.APIException):
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from rest_framework.permissions import BasePermission
22

3-
from pretalx.person.rules import is_only_reviewer
3+
from eventyay.talk_rules.person import is_only_reviewer
44

55
MODEL_PERMISSION_MAP = {
66
"list": "list",
@@ -22,7 +22,7 @@
2222
class ApiPermission(BasePermission):
2323

2424
def get_permission_object(self, view, obj, request, detail=False):
25-
return obj or getattr(request, "event", None) or request.organiser
25+
return obj or getattr(request, "event", None) or request.organizer
2626

2727
def has_permission(self, request, view):
2828
return self._has_permission(view, None, request)

talk/src/pretalx/api/serializers/access_code.py renamed to app/eventyay/api/serializers/access_code.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from rest_flex_fields.serializers import FlexFieldsSerializerMixin
22

3-
from pretalx.api.mixins import PretalxSerializer
4-
from pretalx.api.versions import CURRENT_VERSIONS, register_serializer
5-
from pretalx.submission.models import SubmitterAccessCode
3+
from eventyay.api.mixins import PretalxSerializer
4+
from eventyay.api.versions import CURRENT_VERSIONS, register_serializer
5+
from eventyay.base.models.access_code import SubmitterAccessCode
66

77

88
@register_serializer(versions=CURRENT_VERSIONS)
@@ -20,11 +20,11 @@ class Meta:
2020
)
2121
expandable_fields = {
2222
"track": (
23-
"pretalx.api.serializers.submission.TrackSerializer",
23+
"eventyay.api.serializers.submission.TrackSerializer",
2424
{"read_only": True},
2525
),
2626
"submission_type": (
27-
"pretalx.api.serializers.submission.SubmissionTypeSerializer",
27+
"eventyay.api.serializers.submission.SubmissionTypeSerializer",
2828
{"read_only": True},
2929
),
3030
}

talk/src/pretalx/api/serializers/availability.py renamed to app/eventyay/api/serializers/availability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from django.db import transaction
22
from rest_framework.serializers import BooleanField, ModelSerializer
33

4-
from pretalx.schedule.models import Availability
4+
from eventyay.base.models.availability import Availability
55

66

77
class AvailabilitySerializer(ModelSerializer):

app/eventyay/api/serializers/event.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def to_internal_value(self, data):
7171

7272
class PluginsField(Field):
7373
def to_representation(self, obj):
74-
from pretix.base.plugins import get_all_plugins
74+
from eventyay.base.plugins import get_all_plugins
7575

7676
return sorted(
7777
[
@@ -222,7 +222,7 @@ def validate_seat_category_mapping(self, value):
222222
return {'seat_category_mapping': result}
223223

224224
def validate_plugins(self, value):
225-
from pretix.base.plugins import get_all_plugins
225+
from eventyay.base.plugins import get_all_plugins
226226

227227
plugins_available = {
228228
p.module

0 commit comments

Comments
 (0)