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

fix: Correct invoice permissions and disable post, patch, delete #7312

Merged
merged 3 commits into from
Oct 2, 2020

Conversation

iamareebjamal
Copy link
Member

@iamareebjamal iamareebjamal commented Oct 2, 2020

Add tests to ensure permissions are working correctly

For fossasia/open-event-frontend#5212

@auto-label auto-label bot added the fix label Oct 2, 2020


def test_invoice_post_user_error(client, jwt):
data = json.dumps({'data': {'type': 'event-invoice', 'attributes': {'amount': 100},}})

Choose a reason for hiding this comment

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

missing whitespace after ','



def test_invoice_post_admin_error(client, admin_jwt):
data = json.dumps({'data': {'type': 'event-invoice', 'attributes': {'amount': 100},}})

Choose a reason for hiding this comment

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

missing whitespace after ','

get_invoice(db, user)

response = client.get(
'/v1/event-invoices', content_type='application/vnd.api+json', headers=jwt,

Choose a reason for hiding this comment

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

Black would make changes.

@@ -4,17 +4,14 @@
from flask_jwt_extended import current_user
from flask_rest_jsonapi import ResourceDetail, ResourceList, ResourceRelationship

from app.api.bootstrap import api
from app.api.helpers.db import safe_query, safe_query_kwargs, save_to_db
from app.api.helpers.db import safe_query, safe_query_by_id, safe_query_kwargs, save_to_db

Choose a reason for hiding this comment

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

Black would make changes.

@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

Merging #7312 into development will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #7312      +/-   ##
===============================================
+ Coverage        64.00%   64.12%   +0.12%     
===============================================
  Files              259      259              
  Lines            13075    13078       +3     
===============================================
+ Hits              8368     8386      +18     
+ Misses            4707     4692      -15     
Impacted Files Coverage Δ
app/api/event_invoices.py 63.15% <100.00%> (+15.73%) ⬆️
app/api/helpers/tasks.py 17.18% <0.00%> (-0.19%) ⬇️
app/api/helpers/payment.py 24.05% <0.00%> (-0.16%) ⬇️
app/api/helpers/mail.py 37.39% <0.00%> (ø)
app/api/helpers/db.py 100.00% <0.00%> (+1.53%) ⬆️
app/api/helpers/query.py 56.52% <0.00%> (+13.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a4a8dab...d97ca68. Read the comment docs.

@iamareebjamal iamareebjamal merged commit a0a7269 into development Oct 2, 2020
@iamareebjamal iamareebjamal deleted the invoice-permissions branch October 2, 2020 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants