mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
invite: Extend invite api for handling expiration duration.
This extends the invite api endpoints to handle an extra argument, expiration duration, which states the number of days before the invitation link expires. For prereg users, expiration info is attached to event object to pass it to invite queue processor in order to create and send confirmation link. In case of multiuse invites, confirmation links are created directly inside do_create_multiuse_invite_link(), For filtering valid user invites, expiration info stored in Confirmation object is used, which is accessed by a prereg user using reverse generic relations. Fixes #16359.
This commit is contained in:
@@ -14,7 +14,7 @@ from django.utils.timesince import timesince
|
||||
from django.utils.timezone import now as timezone_now
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
from confirmation.models import Confirmation, _properties, confirmation_url
|
||||
from confirmation.models import Confirmation, confirmation_url
|
||||
from confirmation.settings import STATUS_ACTIVE
|
||||
from zerver.decorator import require_server_admin
|
||||
from zerver.forms import check_subdomain_available
|
||||
@@ -73,8 +73,7 @@ def get_confirmations(
|
||||
content_object = confirmation.content_object
|
||||
|
||||
type = confirmation.type
|
||||
days_to_activate = _properties[type].validity_in_days
|
||||
expiry_date = confirmation.date_sent + timedelta(days=days_to_activate)
|
||||
expiry_date = confirmation.expiry_date
|
||||
|
||||
assert content_object is not None
|
||||
if hasattr(content_object, "status"):
|
||||
|
||||
Reference in New Issue
Block a user