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

Add Celery to Media #388

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions zubhub_backend/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:
dockerfile: ./compose/media/dev/Dockerfile
restart: on-failure
volumes:
- ./media:/home/media
- media_data:/home/media/media_store
- ./compose/media/requirements.txt:/home/requirements.txt:ro
ports:
Expand Down
11 changes: 7 additions & 4 deletions zubhub_backend/zubhub/creators/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ def get(self, request, format=None):
class UserProfileAPIView(RetrieveAPIView):
"""
Fetch Profile of user with given username.

Requires username of user.
Returns user profile.

Note that this schema returns the full user profile, but the api sometimes
returns a minimal version of the user profile, omitting certain fields that
are not neccessary or are sensitive.
"""

queryset = Creator.objects.filter(is_active=True)
Expand All @@ -91,10 +94,10 @@ class UserProfileAPIView(RetrieveAPIView):
throttle_classes = [GetUserRateThrottle, SustainedRateThrottle]

def get_serializer_class(self):
if self.kwargs.get("username") == self.request.user.username:
return CreatorSerializer
else:
if self.request and self.kwargs.get("username") != self.request.user.username:
return CreatorMinimalSerializer
else:
return CreatorSerializer


class RegisterCreatorAPIView(RegisterView):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const styles = theme => ({
alignItems: 'center',
},
dividerText: {
whiteSpace: 'nowrap',
[theme.breakpoints.up('1600')]: {
fontSize: '1.2rem',
},
Expand Down
2 changes: 1 addition & 1 deletion zubhub_frontend/zubhub/src/views/PageWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function PageWrapper(props) {
name="q"
id="q"
type="search"
defaultValue={props.location.search && getQueryParams(props.location.search).query}
defaultValue={getQueryParams(window.location.href).get('q')}
className={clsx(
classes.searchFormInputStyle,
'search-form-input',
Expand Down