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 11 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
11 changes: 11 additions & 0 deletions server/venueless/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ 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
trait_grants = {
"admin": ["admin"],
"attendee": (
[attendee_trait_grants] if attendee_trait_grants else ["attendee"]
),
"scheduleuser": ["schedule-update"],
}

# if world already exists, update it, otherwise create a new world
world_id = request.data.get("id")
domain_path = "{}{}/{}".format(
Expand All @@ -165,6 +174,7 @@ 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 = trait_grants
world.save()
else:
world = World.objects.create(
Expand All @@ -174,6 +184,7 @@ def post(request, *args, **kwargs) -> JsonResponse:
locale=request.data.get("locale") or "en",
timezone=request.data.get("timezone") or "UTC",
config=config,
trait_grants=trait_grants,
)

site_url = settings.SITE_URL
Expand Down
Loading