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

Assign t2 reviewer permission to demo user upon reset #664

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion miqa/core/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import dateparser
from django.conf import settings
from django.contrib.auth.models import User
from guardian.shortcuts import assign_perm
import pandas
from rest_framework.exceptions import APIException

Expand Down Expand Up @@ -53,13 +54,15 @@ def _download_from_s3(path: str, public: bool) -> bytes:
def reset_demo():
Project.objects.all().delete()

demo_user = User.objects.get(username='test@miqa.dev')
demo_project = Project(
name='Demo Project',
creator=User.objects.get(username='test@miqa.dev'),
creator=demo_user,
import_path='s3://miqa-storage/IXI_demo.csv',
export_path='samples/demo.json',
)
demo_project.save()
assign_perm('tier_2_reviewer', demo_user, demo_project)

import_data(demo_project.id)

Expand Down