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

#208 Add functionality to mark user_program as complete #220

Merged
merged 5 commits into from
Dec 13, 2021

Conversation

GauravGusain98
Copy link
Contributor

#208

Please complete the following steps and check these boxes before filing your PR:

Types of changes

  • Bug fix (a change which fixes an issue)
  • New feature (a change which adds functionality)

Short description of what this resolves:

  • Marking user_program as complete when the "is_last_content" value is "true"

Checklist:

  • I have performed a self-review of my own code.
  • The code follows the style guidelines of this project.
  • The code changes are passing the CI checks
  • I have documented my code wherever required.
  • The changes requires a change to the documentation.
  • I have updated the documentation based on the my changes.

@GauravGusain98 GauravGusain98 self-assigned this Dec 12, 2021
@GauravGusain98 GauravGusain98 changed the title add functionality to mark user_program as complete #208 Add functionality to mark user_program as complete Dec 12, 2021

def mark_user_program_as_completed(self, JsonData):
self.set_init_data(JsonData)
self.user_program_data = models.UserProgram.get_by_user_id(self.user_id)
Copy link
Member

Choose a reason for hiding this comment

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

This will be futuristic, but what will happen in the case of multiple user experiences?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get_by_user_id function give use the latest active (i.e status = in-progress) user_program.

Comment on lines -18 to -20
def get_by_user_id(self, user_id):
return self.filter(Registration.user_id == user_id).first()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

duplicate

Comment on lines +10 to +11
if not user_program_details:
user_program_details = self.get_latest_user_program(user_id)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

in case there is no active user_program. As we have not yet decided how we will do resign up for these users. So currently not creating a new user program for completed users.

@GauravGusain98 GauravGusain98 merged commit 4eaffca into develop Dec 13, 2021
@GauravGusain98 GauravGusain98 deleted the feature/208-mark-user-program-as-completed branch December 13, 2021 04:09
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.

2 participants