Skip to content

prevent multiple active applications by a member to an opening - #164

Merged
bedeho merged 4 commits into
Joystream:developmentfrom
mnaamani:fix/163
Feb 27, 2020
Merged

prevent multiple active applications by a member to an opening#164
bedeho merged 4 commits into
Joystream:developmentfrom
mnaamani:fix/163

Conversation

@mnaamani

Copy link
Copy Markdown
Member

Fixes#163

@mnaamani
mnaamani requested a review from bedehoFebruary 26, 2020 08:52
Comment threadsrc/content_working_group/lib.rs Outdated
opening_id: CuratorOpeningId<T>,
member_id: T::MemberId,
) -> Result<(), &'static str> {
for (_id, curator_application) in <CuratorApplicationById<T>>::enumerate() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This iterates all applications on all openings, which is not great, or entirely safe.

At the very least there is CuratorOpening::curator_applications of type BTreeSet<CuratorApplicationId> which allows you to iterate only applications to the given curator opening. This is still not great, but we will do a refactor later where membership binding is done inside subsystem modules, not in membership module, which would make the lookup direct, so this may be the best we can do for now, short of introducing a temporary reverse index.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to iterate only over curator opening applications 👍

@mnaamani
mnaamani requested a review from bedehoFebruary 26, 2020 12:10
@bedeho
bedeho merged commit 10a07fa into Joystream:developmentFeb 27, 2020
@mnaamani
mnaamani deleted the fix/163 branch May 22, 2020 20:31
@bedehobedeho mentioned this pull request Feb 7, 2020
9 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@mnaamani@bedeho