Skip to content

Commit

Permalink
missed lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobfilik committed Jun 20, 2024
1 parent 8720bf4 commit 50a2622
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions xas-standards-api/src/xas_standards_api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
print("RUNNING IN DEV MODE")
dev = True


async def get_current_user(
auth: HTTPAuthorizationCredentials = Depends(get_bearer_token),
):
Expand Down
3 changes: 2 additions & 1 deletion xas-standards-api/src/xas_standards_api/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class LicenceType(enum.Enum):
cc_0 = "cc_0"
logged_in_only = "logged_in_only"


class PersonInput(SQLModel):
identifier: str = Field(index=True, unique=True)

Expand All @@ -25,7 +26,6 @@ class Person(PersonInput, table=True):
admin: bool = False



class Element(SQLModel, table=True):
__tablename__: str = "element"

Expand Down Expand Up @@ -127,6 +127,7 @@ class XASStandard(XASStandardInput, table=True):
}
)


class XASStandardAdminReviewInput(SQLModel):
reviewer_comments: Optional[str] = None
review_status: ReviewStatus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ class FacilityResponse(SQLModel):
city: str
country: str


class BeamlineResponse(SQLModel):
id: int
name: str
notes: str
facility: FacilityResponse


class XASStandardResponse(XASStandardInput):
id: int | None
element: Element
Expand All @@ -28,12 +30,9 @@ class XASStandardResponse(XASStandardInput):
class AdminXASStandardResponse(XASStandardResponse):
submitter: Person


class MetadataResponse(SQLModel):
beamlines: List[BeamlineResponse]
elements: List[Element]
edges: List[Edge]
licences: List[str]




2 changes: 1 addition & 1 deletion xas-standards-api/src/xas_standards_api/routers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ def read_standards_admin(
user_id: str = Depends(get_current_user),
) -> CursorPage[AdminXASStandardResponse]:

return get_standards_admin(session,user_id)
return get_standards_admin(session, user_id)
5 changes: 3 additions & 2 deletions xas-standards-api/src/xas_standards_api/routers/open.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

router = APIRouter()


@router.get("/api/standards/{id}")
async def read_standard(
id: int, session: Session = Depends(get_session)
Expand All @@ -31,7 +32,8 @@ def read_standards(
element: str | None = None,
) -> CursorPage[XASStandardResponse]:

return read_standards_page(session,element)
return read_standards_page(session, element)


@router.get("/api/data/{id}")
async def read_data(
Expand All @@ -42,4 +44,3 @@ async def read_data(
return get_file(session, id)

return get_data(session, id)

4 changes: 3 additions & 1 deletion xas-standards-api/src/xas_standards_api/routers/protected.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@

router = APIRouter()


@router.get("/api/user")
async def check(
session: Session = Depends(get_session), user_id: str = Depends(get_current_user)
):

return get_user(session,user_id)
return get_user(session, user_id)


@router.post("/api/standards")
Expand Down Expand Up @@ -71,6 +72,7 @@ def add_standard_file(

return add_new_standard(session, xdi_file, form_input, additional_files)


@router.patch("/api/standards")
def submit_review(
review: XASStandardAdminReviewInput,
Expand Down

0 comments on commit 50a2622

Please sign in to comment.