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

stream line delete-volunteer #100

Open
anandology opened this issue Aug 27, 2015 · 5 comments
Open

stream line delete-volunteer #100

anandology opened this issue Aug 27, 2015 · 5 comments

Comments

@anandology
Copy link
Contributor

As a quick fix to #98, the audit records associated with a user account are also deleted. The whole point of having audit records is to have complete history of events and this action violates the whole purpose.

What we need is:

  • don't delete audit records when a user/volunteer is deleted
  • make sure the audit records are still viewable even after the user is deleted

This can be implemented either by marking the volunteer as deleted (or setting place=null), or deleting the entry completely and set the corresponding ids in the audit records to null. The audit records also maintain a dict of data, so it is still possible to render those records even after deleting the volunteer.

@anandology anandology added this to the Delhi Beta milestone Aug 27, 2015
@anandology anandology changed the title Don't delete audit records when a volunteer is deleted strealine delete-volunteer Aug 27, 2015
@anandology
Copy link
Contributor Author

Also @Raghavpro reported another issue with the current delete-volunteer implementation.

raghav [11:37 AM] 
@anandology: Did you try deleting a volunteer and then registering it again? You won’t be able to.
anandology [11:37 AM] 
why?
raghav [11:45 AM] 
Because pendingmember record of that user is still there.
raghav 
[11:46 AM]  
Added and commented on a Python snippet 
pending_member = PendingMember.find(email=userdata['email'])
if pending_member:
    return render_template("signup.html", userdata=None, pending_member=pending_member)
1 Comment
This check meets and you get “You’ve already applied"
anandology [11:47 AM] 
thanks for finding that bug.
anandology [11:47 AM]
The current implementation is really a quick fix. We'll have to think about something better.
anandology [11:48 AM]
I think pending_member should be deleted after the sign up is approved.

@anandology anandology changed the title strealine delete-volunteer stream line delete-volunteer Aug 27, 2015
@raghavio
Copy link
Collaborator

Also make it so a user can't delete himself.

@anandology
Copy link
Contributor Author

Delete volunteer is not working for volunteers added directly from the website.

see https://opbeat.com/aap/cleansweep-karnataka/errors/4/ for trackback

@raghavio
Copy link
Collaborator

Pending member object does not exist so removing it throws an error.
@anandology we could either add pendingmember object with approved status at the time of adding a volunteer or add a if exist check before removing it. I like the former approach. That way we can see the volunteer in approved list also.

What do you think?

@anandology
Copy link
Contributor Author

I prefer the second one. Just check if it is not None before removing it.

On Thu, Nov 19, 2015 at 9:22 PM, Raghav Sharma [email protected]
wrote:

Pending member object does not exist so removing it throws an error.
@anandology https://github.com/anandology we could either add
pendingmember object with approved status at the time of adding a
volunteer or add a if exist check before removing it. I like the former
approach. That way we can see the volunteer in approved list also.

What do you think?


Reply to this email directly or view it on GitHub
#100 (comment)
.

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

No branches or pull requests

3 participants