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

fix: Error after clicking "start working btn" twice #4878

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kiran-pande-30
Copy link

Fixes #4823

Describe the changes you have made in this PR -

  1. Previously, when a user tried to start working on an assignment and there was already an existing project associated with it, it would show an authorization error message.
  2. To resolve this, I removed the authorization check from the start action of assignment policies, meaning that authorization is no longer enforced at this point.
  3. Instead, I added a condition in the start action of the assignment controller. If an existing project is associated with the assignment, the user will be redirected to that project. If not, a new project is created for the user to start working on.

Screenshots of the changes (If any) -

Issue_4823.mp4

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

@project.build_project_datum
@project.save
redirect_to user_project_path(current_user, @project)
existing_project = @assignment.projects.find_by(author_id:current_user)
Copy link

Choose a reason for hiding this comment

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

Space missing after colon.

Copy link

codeclimate bot commented Apr 8, 2024

Code Climate has analyzed commit b52cf8e and detected 0 issues on this pull request.

View more on Code Climate.

@Kiran-pande-30
Copy link
Author

@tanmoysrt Can u please review this pr?

Sign up for free to 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.

🐞 Bug: Error after click "start working" twice
1 participant