Skip to content

Commit

Permalink
Add default values to comment API methods to please pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
tavinathanson committed Dec 11, 2014
1 parent c7ebb4d commit 83f963b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions cycledash/comments.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""API for user comments."""
# pylint: disable=no-value-for-parameter
from flask import jsonify, request
from functools import wraps
from sqlalchemy import exc, MetaData, Table, select
Expand All @@ -7,6 +8,7 @@
from cycledash.helpers import (prepare_request_data, success_response,
error_response)


def user_comments_db(func):
@wraps(func)
def wrapper(*args, **kwargs):
Expand All @@ -18,7 +20,7 @@ def wrapper(*args, **kwargs):


@user_comments_db
def create_comment(vcf_id, conn, user_comments):
def create_comment(vcf_id, conn=None, user_comments=None):
"""Create a user comment for this VCF ID, and return the created comment ID
and last_modified timestamp as a response.
"""
Expand Down Expand Up @@ -48,7 +50,7 @@ def create_comment(vcf_id, conn, user_comments):


@user_comments_db
def get_comments(vcf_id, conn, user_comments):
def get_comments(vcf_id, conn=None, user_comments=None):
"""Return all user comments in the following format:
{
"comments": {
Expand Down Expand Up @@ -106,7 +108,7 @@ def get_row_key(comment, table):


@user_comments_db
def delete_comment(comment_id, conn, user_comments):
def delete_comment(comment_id, conn=None, user_comments=None):
stmt = user_comments.delete(user_comments.c.id == comment_id)
try:
result = conn.execute(stmt)
Expand All @@ -119,7 +121,7 @@ def delete_comment(comment_id, conn, user_comments):


@user_comments_db
def update_comment(comment_id, conn, user_comments):
def update_comment(comment_id, conn=None, user_comments=None):
"""To update a comment, format PUT data as:
{"comment_text": "<comment text>", "last_modified": <TIMESTAMP>}
Expand Down

0 comments on commit 83f963b

Please sign in to comment.