Skip to content

Commit f365060

Browse files
authored
fix precommits (#1083)
* fix precommits * remove not needed variables * more missing precommit fixes
1 parent 01165b7 commit f365060

File tree

17 files changed

+416
-89
lines changed

17 files changed

+416
-89
lines changed

backend/app/deps/authorization_deps.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
from beanie import PydanticObjectId
2-
from beanie.operators import Or
3-
from fastapi import Depends, HTTPException
41
from app.keycloak_auth import get_current_username, get_read_only_user
52
from app.models.authorization import AuthorizationDB, RoleType
63
from app.models.datasets import DatasetDB, DatasetStatus

backend/app/keycloak_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ async def get_read_only_user(
383383
detail={"error": "Key is invalid."},
384384
headers={"WWW-Authenticate": "Bearer"},
385385
)
386-
except BadSignature as e:
386+
except BadSignature:
387387
raise HTTPException(
388388
status_code=401,
389389
detail={"error": "Key is invalid."},

backend/app/routers/authorization.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ async def set_dataset_user_role(
274274
AuthorizationDB.dataset_id == PydanticObjectId(dataset_id),
275275
AuthorizationDB.role == role,
276276
)
277-
rolename = role.name
278277
if user.read_only_user and role.name is not RoleType.VIEWER.name:
279278
raise HTTPException(
280279
status_code=405, detail=f"User {username} is read only"

backend/app/routers/datasets.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,13 +683,10 @@ async def save_file(
683683
)
684684
file_public = False
685685
file_authenticated = False
686-
file_private = False
687686
if dataset.status == DatasetStatus.PUBLIC:
688687
file_public = True
689688
elif dataset.status == DatasetStatus.AUTHENTICATED:
690689
file_authenticated = True
691-
else:
692-
file_private = True
693690
await add_file_entry(
694691
new_file,
695692
user,

backend/app/search/index.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ async def index_file(
8787
):
8888
metadata.append(md.content)
8989

90-
status = file.status
91-
9290
# Add en entry to the file index
9391
doc = ElasticsearchEntry(
9492
resource_type="file",

backend/app/tests/test_elastic_search.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,6 @@ async def test_public_files():
193193
time.sleep(1)
194194
dummy_file_query = []
195195

196-
query_body = {"query": {"match": {"creator": "xyz"}}}
197-
198196
user_public_clause = {
199197
"bool": {
200198
"should": [

docs/docs/devs/standalone-docker-deployment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@ docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d
6060

6161
4. Access the keycloak admin console at `http://{{IP_ADDRESS}}/keycloak/` and login with the credentials from the `docker-compose.yml` file and finish the steps in [Keycloak](keycloak.md), using the same IP address as the `{hostname}` placeholder.
6262

63-
You shall be able to log in now at `http://{{IP_ADDRESS}}/`.
63+
You shall be able to log in now at `http://{{IP_ADDRESS}}/`.

frontend/src/actions/user.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,13 @@ export function revokeAdmin(email) {
304304
};
305305
}
306306

307-
308307
export const ENABLE_READONLY = "ENABLE_READONLY";
309308

310309
export function enableReadOnly(email) {
311310
return (dispatch) => {
312-
return V2.LoginService.enableReadonlyUserApiV2UsersEnableReadonlyUseremailPost(email)
311+
return V2.LoginService.enableReadonlyUserApiV2UsersEnableReadonlyUseremailPost(
312+
email
313+
)
313314
.then((json) => {
314315
dispatch({
315316
type: ENABLE_READONLY,
@@ -327,7 +328,9 @@ export const DISABLE_READONLY = "DISABLE_READONLY";
327328

328329
export function disableReadOnly(email) {
329330
return (dispatch) => {
330-
return V2.LoginService.disableReadonlyUserApiV2UsersDisableReadonlyUseremailPost(email)
331+
return V2.LoginService.disableReadonlyUserApiV2UsersDisableReadonlyUseremailPost(
332+
email
333+
)
331334
.then((json) => {
332335
dispatch({
333336
type: DISABLE_READONLY,

frontend/src/components/Layout.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,9 @@ export default function PersistentDrawerLeft(props) {
377377
</>
378378
) : null}
379379
<List>
380-
{currUserProfile.read_only_user? (
380+
{currUserProfile.read_only_user ? (
381381
<></>
382-
) :
382+
) : (
383383
<ListItem key={"groups"} disablePadding>
384384
<ListItemButton component={RouterLink} to="/groups">
385385
<ListItemIcon>
@@ -388,33 +388,33 @@ export default function PersistentDrawerLeft(props) {
388388
<ListItemText primary={"Groups"} />
389389
</ListItemButton>
390390
</ListItem>
391-
}
391+
)}
392392
</List>
393393
<Divider />
394394
<List>
395-
{currUserProfile.read_only_user? (
395+
{currUserProfile.read_only_user ? (
396396
<></>
397-
) :
397+
) : (
398398
<ListItem key={"newdataset"} disablePadding>
399399
<ListItemButton component={RouterLink} to="/create-dataset">
400400
<ListItemIcon>
401401
<AddBox />
402402
</ListItemIcon>
403-
<ListItemText primary={"New Dataset"} />
404-
</ListItemButton>
405-
</ListItem>
406-
}
403+
<ListItemText primary={"New Dataset"} />
404+
</ListItemButton>
405+
</ListItem>
406+
)}
407407
</List>
408408
<Divider />
409409
<List>
410-
<ListItem key={"metadataDefinition"} disablePadding>
411-
<ListItemButton component={RouterLink} to="/metadata-definitions">
412-
<ListItemIcon>
413-
<InfoOutlinedIcon />
414-
</ListItemIcon>
415-
<ListItemText primary={"Metadata Definitions"} />
416-
</ListItemButton>
417-
</ListItem>
410+
<ListItem key={"metadataDefinition"} disablePadding>
411+
<ListItemButton component={RouterLink} to="/metadata-definitions">
412+
<ListItemIcon>
413+
<InfoOutlinedIcon />
414+
</ListItemIcon>
415+
<ListItemText primary={"Metadata Definitions"} />
416+
</ListItemButton>
417+
</ListItem>
418418
</List>
419419
<Divider />
420420
<List>

frontend/src/components/PublicLayout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ export default function PersistentDrawerLeft(props) {
9797
const { children } = props;
9898
const theme = useTheme();
9999
const [open, setOpen] = React.useState(false);
100-
const [embeddedPublicSearchHidden, setEmbeddedPublicSearchHidden] = React.useState(false);
100+
const [embeddedPublicSearchHidden, setEmbeddedPublicSearchHidden] =
101+
React.useState(false);
101102
const [anchorEl, setAnchorEl] = React.useState(null);
102103
const isMenuOpen = Boolean(anchorEl);
103104

@@ -236,7 +237,7 @@ export default function PersistentDrawerLeft(props) {
236237
</ListItemButton>
237238
</ListItem>
238239
</List>
239-
<Divider/>
240+
<Divider />
240241
<List>
241242
<ListItem key={"public_search"} disablePadding>
242243
<ListItemButton component={RouterLink} to="/public_search">

0 commit comments

Comments
 (0)