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 renewal form endpoint #1585

Merged
merged 12 commits into from
Oct 22, 2024
Merged

Fix renewal form endpoint #1585

merged 12 commits into from
Oct 22, 2024

Conversation

mwvolo
Copy link
Member

@mwvolo mwvolo commented Oct 18, 2024

This endpoint returns books used and student numbers to pre-populate the renewal form, creating a more frictionless experience for instructors to confirm usage.
This should fix the form auto-population, while also adding some fields that might be useful in the future.

No FE changes are required to support this. It used to work, then it stopped. Now it's back.

Screenshot 2024-10-18 at 12 13 52
This will populate the renewal form with books and previous student count reported by an instructor who has an adoption that needs to be confirmed.

@@ -11,30 +12,46 @@ def handle(self, *args, **options):
now = datetime.datetime.now()

year = now.year
if now.month < 7: # Salesforce needs the school base year, this is how they calculate it
if now.month > 7: # Salesforce needs the school base year, this is how they calculate it
Copy link
Member Author

Choose a reason for hiding this comment

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

@dmoreno27 can you sanity check how i'm calculating this date and the query below?

Copy link
Member Author

Choose a reason for hiding this comment

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

it seems like it might have grabbed the wrong base year before... not sure how it ever worked

If it's after August, it should get the base year before the current year.

Copy link
Contributor

Choose a reason for hiding this comment

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

The base year cut off is June 30. So month would be >= 7.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the current month is July - Dec, then current base year is the current year. if it is Jan - Jun, then the current base year is current year - 1.

@@ -259,7 +259,7 @@
('0 2 * * *', 'django.core.management.call_command', ['delete_resource_downloads']),
('0 6 * * *', 'django.core.management.call_command', ['update_resource_downloads']),
('0 0 8 * *', 'django.core.management.call_command', ['update_schools_and_mapbox']),
('0 9 * * *', 'django.core.management.call_command', ['update_opportunities']),
# ('0 0 1 * *', 'django.core.management.call_command', ['update_opportunities']),
Copy link
Member Author

Choose a reason for hiding this comment

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

to mitigate risk, this is going to be run manually, not on a schedule
main priority here is to get adoption data for folks before a mass renewal email goes out

@mwvolo
Copy link
Member Author

mwvolo commented Oct 21, 2024

@TomWoodward this is ready for a look when you have time.

Creative Services is planning to send a mass renewal email in the next two weeks and I was hoping to get this out before then (it'll make the user experience a lot better). Do you have any concerns with me merging, moving this to staging, getting some folks to help test, then moving to production next week?

Copy link
Member

@TomWoodward TomWoodward left a comment

Choose a reason for hiding this comment

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

sounds good, i also wanted to do a cms/web release for some fixes we have pending

@mwvolo mwvolo merged commit 25a47b6 into main Oct 22, 2024
2 checks passed
@mwvolo mwvolo deleted the fix-renewal-form-endpoint branch October 22, 2024 15:53
Copy link

sentry-io bot commented Oct 24, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ ValidationError: '“%(value)s” is not a valid UUID.' salesforce.management.commands.update_opportuni... View Issue
  • ‼️ ValueError: badly formed hexadecimal UUID string salesforce.management.commands.update_opportuni... View Issue
  • ‼️ TypeError: 'NoneType' object is not subscriptable salesforce.management.commands.update_opportuni... View Issue

Did you find this useful? React with a 👍 or 👎

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.

3 participants