Skip to content

Commit

Permalink
remove 'admin_override_suspend_auto_approval' field
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdarkdragon committed Aug 23, 2018
1 parent 086d562 commit a08bb02
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/dashboard/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ def create_new_bounty(old_bounties, bounty_payload, bounty_details, bounty_id):
'bounty_owner_address': bounty_issuer.get('address', ''),
'bounty_owner_email': bounty_issuer.get('email', ''),
'bounty_owner_name': bounty_issuer.get('name', ''),
'auto_approve_workers': bounty_payload.get('schemes', {}).get('auto_approve_workers', 1),
})
else:
latest_old_bounty_dict = latest_old_bounty.to_standard_dict(
Expand All @@ -425,7 +426,7 @@ def create_new_bounty(old_bounties, bounty_payload, bounty_details, bounty_id):
'project_length', 'experience_level', 'project_type', 'permission_type', 'attached_job_description',
'bounty_owner_github_username', 'bounty_owner_address', 'bounty_owner_email', 'bounty_owner_name',
'github_comments', 'override_status', 'last_comment_date', 'snooze_warnings_for_days',
'admin_override_and_hide', 'admin_override_suspend_auto_approval', 'admin_mark_as_remarket_ready'
'admin_override_and_hide', 'auto_approve_workers', 'admin_mark_as_remarket_ready'
],
)
bounty_kwargs.update(latest_old_bounty_dict)
Expand Down
3 changes: 0 additions & 3 deletions app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,6 @@ class Bounty(SuperModel):
admin_override_and_hide = models.BooleanField(
default=False, help_text=_('Admin override to hide the bounty from the system')
)
admin_override_suspend_auto_approval = models.BooleanField(
default=False, help_text=_('Admin override to suspend work auto approvals')
)
admin_mark_as_remarket_ready = models.BooleanField(
default=False, help_text=_('Admin override to mark as remarketing ready')
)
Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ def helper_handle_suspend_auto_approval(request, bounty):
is_staff = request.user.is_staff
is_moderator = request.user.profile.is_moderator if hasattr(request.user, 'profile') else False
if is_staff or is_moderator:
bounty.admin_override_suspend_auto_approval = True
bounty.auto_approve_workers = True
bounty.save()
messages.success(request, _(f'Bounty auto approvals are now suspended'))
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ def helper_execute(threshold, func_to_execute, action_str):
if not bounty.auto_approve_workers:
print("skipped bc of auto_approve_workers")
continue
if bounty.admin_override_suspend_auto_approval: # skip bounties where this flag is set
print("skipped bc of admin_override_suspend_auto_approval")
continue
if has_approved_worker_already:
print("skipped bc of has_approved_worker_already")
continue
Expand Down

0 comments on commit a08bb02

Please sign in to comment.