Skip to content
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

Setup attendee role and Configure video settings for talks #285

Open
wants to merge 19 commits into
base: development
Choose a base branch
from
Open
Changes from 9 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
20 changes: 20 additions & 0 deletions server/venueless/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def post(request, *args, **kwargs) -> JsonResponse:

title = titles.get(locale) or titles.get("en") or title_default

attendee_trait_grants = request.data.get("traits", {}).get("attendee", "")
odkhang marked this conversation as resolved.
Show resolved Hide resolved

# if world already exists, update it, otherwise create a new world
world_id = request.data.get("id")
domain_path = "{}{}/{}".format(
Expand All @@ -165,6 +167,15 @@ def post(request, *args, **kwargs) -> JsonResponse:
world.domain = domain_path
world.locale = request.data.get("locale") or "en"
world.timezone = request.data.get("timezone") or "UTC"
world.trait_grants = {
odkhang marked this conversation as resolved.
Show resolved Hide resolved
"admin": ["admin"],
"attendee": (
[attendee_trait_grants]
if attendee_trait_grants
else ["attendee"]
),
odkhang marked this conversation as resolved.
Show resolved Hide resolved
"scheduleuser": ["schedule-update"],
}
world.save()
else:
world = World.objects.create(
Expand All @@ -174,6 +185,15 @@ def post(request, *args, **kwargs) -> JsonResponse:
locale=request.data.get("locale") or "en",
timezone=request.data.get("timezone") or "UTC",
config=config,
trait_grants={
"admin": ["admin"],
"attendee": (
[attendee_trait_grants]
if attendee_trait_grants
else ["attendee"]
),
"scheduleuser": ["schedule-update"],
},
)

site_url = settings.SITE_URL
Expand Down
Loading