Skip to content

Commit

Permalink
allow Organisation update
Browse files Browse the repository at this point in the history
  • Loading branch information
CHRISTOPHERKADOGO committed Jul 17, 2024
1 parent 8974de9 commit 5a5b108
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ paths:
type: string
is_public:
type: boolean

organisation:
type: string
responses:
200:
description: "Success"
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from types import SimpleNamespace
from app.helpers.activity_logger import log_activity
from app.helpers.kube import disable_project, enable_project
from app.schemas.user import UserUpdateSchema
from flask import current_app, render_template
from flask_restful import Resource, request
from flask_bcrypt import Bcrypt
Expand Down Expand Up @@ -429,8 +430,8 @@ def patch(self, user_id):
"""
"""
try:
user_schema = UserSchema(only=("name", "is_public"))


user_schema = UserUpdateSchema()
user_data = request.get_json()

current_user_id = get_jwt_identity()
Expand Down
5 changes: 5 additions & 0 deletions app/schemas/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class UserSchema(Schema):

def get_age(self, obj):
return get_item_age(obj.date_created)

class UserUpdateSchema(Schema):
name = fields.Str(required=False)
is_public = fields.Boolean(required=False)
organisation = fields.Str(required=False)


class ActivityLogSchema(Schema):
Expand Down

0 comments on commit 5a5b108

Please sign in to comment.