-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #661 from OpenImaging/fully-reset-demo
Fully reset projects on demo instance, including scan decisions
- Loading branch information
Showing
1 changed file
with
7 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,23 +51,17 @@ def _download_from_s3(path: str, public: bool) -> bytes: | |
|
||
@shared_task | ||
def reset_demo(): | ||
demo_user = User.objects.get(username='[email protected]') | ||
demo_project, created = Project.objects.get_or_create( | ||
Project.objects.delete() | ||
|
||
demo_project = Project( | ||
name='Demo Project', | ||
defaults={ | ||
'creator': demo_user, | ||
'import_path': 's3://miqa-storage/IXI_demo.csv', | ||
'export_path': 'samples/demo.json', | ||
}, | ||
creator=User.objects.get(username='[email protected]'), | ||
import_path='s3://miqa-storage/IXI_demo.csv', | ||
export_path='samples/demo.json', | ||
) | ||
if not created: | ||
demo_project.creator = demo_user | ||
demo_project.import_path = 's3://miqa-storage/IXI_demo.csv' | ||
demo_project.export_path = 'samples/demo.json' | ||
demo_project.save() | ||
demo_project.save() | ||
|
||
import_data(demo_project.id) | ||
Project.objects.exclude(id=demo_project.id).delete() | ||
|
||
|
||
@shared_task | ||
|