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

Speaker Edit shows error "call for speaker not issued yet" if there is no CfS #5341

Closed
mariobehling opened this issue Oct 21, 2020 · 8 comments · Fixed by #5387
Closed

Speaker Edit shows error "call for speaker not issued yet" if there is no CfS #5341

mariobehling opened this issue Oct 21, 2020 · 8 comments · Fixed by #5387

Comments

@mariobehling
Copy link
Member

If a user edits and saves a speaker on an event with an deactivated call for speakers an error message appears "call for speaker not issued yet". The form also moves back to the event instead of the speaker page after editing.

Compare: https://eventyay.com/e/1f720482/cfs/speaker/4885/edit

@maze-runnar
Copy link
Contributor

if CFS is closed or off then is it allowed to edit the speaker?

@mariobehling
Copy link
Member Author

if CFS is closed or off then is it allowed to edit the speaker?

Yes, as of now it should always be allowed to edit a speaker. We need to implement a "lock speaker" feature same as "lock session" later. If a speaker is not locked (which is not possible at the moment) the speaker should be editable.

@maze-runnar
Copy link
Contributor

If CFS Is closed, it will not show in side menu, And if it is not shown in side menu, how user will be able to edit?

@maze-runnar
Copy link
Contributor

@iamareebjamal is it a server issue?

@maze-runnar
Copy link
Contributor

if CFS is closed or off then is it allowed to edit the speaker?

Yes, as of now it should always be allowed to edit a speaker. We need to implement a "lock speaker" feature same as "lock session" later. If a speaker is not locked (which is not possible at the moment) the speaker should be editable.

 if not can_edit_after_cfs_ends(speaker.event_id):
            raise ForbiddenError(
                {'source': ''}, "Cannot edit speaker after the call for speaker is ended"
            )

this code in server state that can't edit speaker afrer closed CFS.

@maze-runnar
Copy link
Contributor

def can_edit_after_cfs_ends(event_id):
    """
    Method to check that user has permission to edit the speaker or session
    after the CFS ends
    """
    speakers_call = SpeakersCall.query.filter_by(
        event_id=event_id, deleted_at=None
    ).one_or_none()
    if speakers_call:
        speakers_call_tz = speakers_call.ends_at.tzinfo
        return not (
            speakers_call.ends_at <= datetime.now().replace(tzinfo=speakers_call_tz)
            and not (
                has_access('is_admin')
                or has_access('is_organizer', event_id=event_id)
                or has_access('is_coorganizer', event_id=event_id)
            )
        )
    else:
        raise ForbiddenError(
            {'source': '/data/event-id'},
            'Speaker Calls for event {id} not found'.format(id=event_id),
        )

@maze-runnar
Copy link
Contributor

@iamareebjamal what need to be done here?

@iamareebjamal
Copy link
Member

Allow the editing of the speaker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants