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

Maintenance mode #1539

Merged
merged 1 commit into from
Jul 28, 2022
Merged

Maintenance mode #1539

merged 1 commit into from
Jul 28, 2022

Conversation

longhotsummer
Copy link
Contributor

Staff view:

image

Everyone else:

image


def ping(request):
return HttpResponse("pong", content_type="text/plain")


DEFAULT_PERMS = (IsAuthenticated,)
DEFAULT_PERMS = (IsAuthenticated, NotMaintenanceMode)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets default permissions for all internal API views

@@ -39,6 +41,9 @@ class AbstractAuthedIndigoView(PermissionRequiredMixin, IndigoJSViewMixin):
must_accept_terms = True

def dispatch(self, request, *args, **kwargs):
if is_maintenance_mode(request):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prevents all views that require authentication from loading.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@longhotsummer longhotsummer merged commit e133f73 into master Jul 28, 2022
@longhotsummer longhotsummer deleted the maint-mode branch July 28, 2022 10:17
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.

2 participants