-
Notifications
You must be signed in to change notification settings - Fork 1
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
chg ! admin panel - process deduplication set - is supersuser #103
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #103 +/- ##
===========================================
- Coverage 95.18% 94.50% -0.69%
===========================================
Files 73 73
Lines 1538 1547 +9
Branches 168 169 +1
===========================================
- Hits 1464 1462 -2
- Misses 51 62 +11
Partials 23 23 ☔ View full report in Codecov by Sentry. |
@button( | ||
label="Process", | ||
permission=lambda request, obj, **kw: request.user.is_superuser, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vitali-yanushchyk-valor pls check how is_root
is defined in hope
ccea19f
to
fd743ac
Compare
@@ -1,4 +1,4 @@ | |||
from hope_dedup_engine.config import env | |||
|
|||
ROOT_TOKEN = env("ROOT_TOKEN") | |||
ROOT_TOKEN_HEADER = env("ROOT_TOKEN_HEADER", default="x-root-token") | |||
ROOT_TOKEN = env("ROOT_ACCESS_TOKEN") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vitali-yanushchyk-valor why are we changing env name?
@@ -45,11 +46,12 @@ class DeduplicationSetAdmin(AdminFiltersMixin, ExtraButtonsMixin, ModelAdmin): | |||
def has_add_permission(self, request): | |||
return False | |||
|
|||
@button(label="Process") | |||
@button(permission=is_root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vitali-yanushchyk-valor let's do have a function
if the status is failed you can rerun if superuser
if you are root you can run in any status
fd743ac
to
ace6668
Compare
No description provided.