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

chg ! admin panel - process deduplication set - is supersuser #103

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

vitali-yanushchyk-valor
Copy link
Contributor

No description provided.

@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.

Project coverage is 94.50%. Comparing base (4920915) to head (ace6668).

Files with missing lines Patch % Lines
...pe_dedup_engine/apps/api/admin/deduplicationset.py 66.66% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@button(
label="Process",
permission=lambda request, obj, **kw: request.user.is_superuser,
)
Copy link
Collaborator

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

@@ -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")
Copy link
Collaborator

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)
Copy link
Collaborator

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

@domdinicola domdinicola merged commit ced0248 into develop Oct 31, 2024
15 checks passed
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.

Add admin button from deduplication set to rerun process of the deduplication set
3 participants