This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SocialJWTCompleteAuthView(SocialJWTOnlyAuthView): | |
@method_decorator(never_cache) | |
def post(self, request, *args, **kwargs): | |
input_data = self.get_serializer_in_data() | |
self.set_input_data(request, input_data) | |
decorate_request(request, self.get_provider_name(input_data)) | |
partial = partial_pipeline_data(request.backend, request=request, *args, **kwargs) | |
if not partial: | |
raise ParseError() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import OrderedDict | |
from rest_framework.pagination import LimitOffsetPagination | |
class LimitOffsetPaginationNoCount(LimitOffsetPagination): | |
def paginate_queryset(self, queryset, request, view=None): | |
self.limit = self.get_limit(request) | |
if self.limit is None: | |
return None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -ex | |
if [ "$1" = "build" ]; then | |
cd /tmp/build | |
mkdir -p cache | |
pip install --cache-dir cache -r requirements.txt | |
pip freeze > requirements_frozen.txt | |
pip list --outdated --format columns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createSelector, createSelectorCreator, defaultMemoize } from 'reselect' | |
function changeMemoize(func, changeCallback) { | |
const defaultMemoizeInstance = defaultMemoize(func); | |
if (changeCallback === undefined) { | |
return defaultMemoizeInstance | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function createDynamicSelector() { | |
let subSelectors = null; | |
let actualSelector = null; | |
return (state, props, ...args) => { | |
// Check to see if the sub state has change | |
const subState = state.get('subState'); | |
if (subSelectors === null || !Set(subState.keys()).equals(Set(subSelectors.keys()))) { | |
// Rebuild our the selectors - could obviously update if required. | |
subSelectors = subState.map((value, key) => { |