-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Try unpinning testing reqs #2863
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,8 +24,8 @@ | |
class BookmarkExistsView(View): | ||
|
||
@method_decorator(csrf_exempt) | ||
def dispatch(self, *args, **kwargs): | ||
return super(BookmarkExistsView, self).dispatch(*args, **kwargs) | ||
def dispatch(self, request, *args, **kwargs): | ||
return super(BookmarkExistsView, self).dispatch(request, *args, **kwargs) | ||
|
||
def get(self, request): | ||
return HttpResponse( | ||
|
@@ -80,8 +80,8 @@ class BookmarkListView(ListView): | |
model = Bookmark | ||
|
||
@method_decorator(login_required) | ||
def dispatch(self, *args, **kwargs): | ||
return super(BookmarkListView, self).dispatch(*args, **kwargs) | ||
def dispatch(self, request, *args, **kwargs): | ||
return super(BookmarkListView, self).dispatch(request, *args, **kwargs) | ||
|
||
def get_queryset(self): | ||
return Bookmark.objects.filter(user=self.request.user) | ||
|
@@ -93,8 +93,8 @@ class BookmarkAddView(View): | |
|
||
@method_decorator(login_required) | ||
@method_decorator(csrf_exempt) | ||
def dispatch(self, *args, **kwargs): | ||
return super(BookmarkAddView, self).dispatch(*args, **kwargs) | ||
def dispatch(self, request, *args, **kwargs): | ||
return super(BookmarkAddView, self).dispatch(request, *args, **kwargs) | ||
|
||
def get(self, request): | ||
return HttpResponse( | ||
|
@@ -156,8 +156,8 @@ class BookmarkRemoveView(View): | |
|
||
@method_decorator(login_required) | ||
@method_decorator(csrf_exempt) | ||
def dispatch(self, *args, **kwargs): | ||
return super(BookmarkRemoveView, self).dispatch(*args, **kwargs) | ||
def dispatch(self, request, *args, **kwargs): | ||
return super(BookmarkRemoveView, self).dispatch(request, *args, **kwargs) | ||
|
||
def get(self, request, *args, **kwargs): | ||
return render_to_response( | ||
|
@@ -175,30 +175,29 @@ def post(self, request, *args, **kwargs): | |
bookmark = get_object_or_404(Bookmark, pk=kwargs['bookmark_pk']) | ||
bookmark.delete() | ||
return HttpResponseRedirect(reverse('bookmark_list')) | ||
else: | ||
try: | ||
post_json = json.loads(request.body) | ||
project = Project.objects.get(slug=post_json['project']) | ||
version = project.versions.get(slug=post_json['version']) | ||
url = post_json['url'] | ||
page = post_json['page'] | ||
except KeyError: | ||
return HttpResponseBadRequest( | ||
json.dumps({'error': "Invalid parameters"}) | ||
) | ||
|
||
bookmark = get_object_or_404( | ||
Bookmark, | ||
user=request.user, | ||
url=url, | ||
project=project, | ||
version=version, | ||
page=page | ||
try: | ||
post_json = json.loads(request.body) | ||
project = Project.objects.get(slug=post_json['project']) | ||
version = project.versions.get(slug=post_json['version']) | ||
url = post_json['url'] | ||
page = post_json['page'] | ||
except KeyError: | ||
return HttpResponseBadRequest( | ||
json.dumps({'error': "Invalid parameters"}) | ||
) | ||
bookmark.delete() | ||
|
||
return HttpResponse( | ||
json.dumps({'removed': True}), | ||
status=200, | ||
content_type="application/json" | ||
) | ||
bookmark = get_object_or_404( | ||
Bookmark, | ||
user=request.user, | ||
url=url, | ||
project=project, | ||
version=version, | ||
page=page | ||
) | ||
bookmark.delete() | ||
|
||
return HttpResponse( | ||
json.dumps({'removed': True}), | ||
status=200, | ||
content_type="application/json" | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we just delete this file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps with another PR? I don't think the bookmarks code needs to live in our repo |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,8 @@ class Meta: | |
model = Version | ||
fields = ['active', 'privacy_level', 'tags'] | ||
|
||
def save(self, *args, **kwargs): | ||
obj = super(VersionForm, self).save(*args, **kwargs) | ||
def save(self, commit=True): | ||
obj = super(VersionForm, self).save(commit=commit) | ||
if obj.active and not obj.built and not obj.uploaded: | ||
trigger_build(project=obj.project, version=obj) | ||
return obj | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do worry that this class of change will have spiraling effects that only show up in run time. Is there a reason we don't want to continue accepting args & kwargs for these things? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this case, we should have never pushed In cases where there are many arguments, I don't know what's best there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rinse and repeat :)