This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from project.trialsites.models import TrialSite, TrialSiteUser | |
from project.accounts.models import User | |
email = '*****@nhs.net' | |
trial_id = 'EX6018-4915' | |
site_reference = '5413' | |
user = User.objects.get(email=email) | |
trial_site = TrialSite.objects.get(site_reference=site_reference, trial__global_trial_id=trial_id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://dabapps.mydonedone.com/issuetracker/projects/45387/issues/1470 | |
// In order to let user regenerate a report with a different comparison group, we need to delete the `ReportGenerationBatch` from the database. | |
// The following worked because the report generation was on `manual` rather than `auto` and the activity only had `1` `ActivityProductVersion` | |
from project.assets.models.activities import Activity | |
activity = Activity.objects.get(id='f252ddd8-4f9c-4b0d-ad2e-698e74db6e79') | |
activity_product_version = activity.activity_product_version_items.get() | |
emails = ['[email protected]', '[email protected]', '[email protected]'] | |
activity_product_version.reportgenerationbatch_set.filter(session__user__email__in=emails).count() |