Skip to content

Commit

Permalink
lint: run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Apr 23, 2024
1 parent a2387ca commit b5cd61f
Show file tree
Hide file tree
Showing 15 changed files with 46 additions and 34 deletions.
6 changes: 3 additions & 3 deletions backend/gn_module_zh/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,9 +844,9 @@ def update_zh_tab6(data):
TZH.update_author: data["update_author"],
TZH.update_date: data["update_date"],
TZH.is_other_inventory: is_other_inventory,
TZH.remark_is_other_inventory: data["remark_is_other_inventory"]
if is_other_inventory
else None,
TZH.remark_is_other_inventory: (
data["remark_is_other_inventory"] if is_other_inventory else None
),
}
)
DB.session.flush()
Expand Down
16 changes: 10 additions & 6 deletions backend/gn_module_zh/hierarchy.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,11 @@ def __str__(self):
"qualification": self.__get_qualif_mnemo(),
"knowledge": self.__get_knowledge_mnemo(),
"name": self.__get_rule_name(),
"note": Hierarchy.get_str_note(self.note, self.denominator)
if self.active
else "Non paramétrée",
"note": (
Hierarchy.get_str_note(self.note, self.denominator)
if self.active
else "Non paramétrée"
),
}


Expand Down Expand Up @@ -973,9 +975,11 @@ def get_note(value):
filter(
None,
[
(float(item["note"].split("/")[0]))
if item["note"] is not None
else None
(
(float(item["note"].split("/")[0]))
if item["note"] is not None
else None
)
for item in value
if item["active"]
],
Expand Down
1 change: 1 addition & 0 deletions backend/gn_module_zh/migrations/01cb1aaa2062_init_zh.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-03-27 11:54:34.602380
"""

import importlib

from alembic import op
Expand Down
1 change: 1 addition & 0 deletions backend/gn_module_zh/migrations/22b14fc3abe0_set_srid.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-04-19 14:58:14.295664
"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-06-05 12:07:39.416188
"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-05-25 15:33:36.262722
"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-06-05 12:20:36.897280
"""

from alembic import op
import sqlalchemy as sa

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Create Date: 2023-03-27 13:32:22.741263
"""

import importlib

from alembic import op
Expand Down
2 changes: 1 addition & 1 deletion backend/gn_module_zh/model/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ def __set_localisation(self):
self.info.localisation = Localisation(
self.id_zh,
self.properties["geo_info"]["regions"],
self.properties["geo_info"]["departments"]
self.properties["geo_info"]["departments"],
# self.ref_geo_config
)

Expand Down
8 changes: 5 additions & 3 deletions backend/gn_module_zh/model/zh.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,11 @@ def get_instruments(self):
"instruments": [
{
"id_instrument": instrument.id_instrument,
"instrument_date": instrument.instrument_date.date().strftime("%d/%m/%Y")
if instrument.instrument_date
else None,
"instrument_date": (
instrument.instrument_date.date().strftime("%d/%m/%Y")
if instrument.instrument_date
else None
),
}
for instrument in ZH.get_data_by_id(TInstruments, self.zh.id_zh)
]
Expand Down
14 changes: 7 additions & 7 deletions frontend/app/services/zh-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class ZhDataService {

constructor(
private _api: HttpClient,
public config: ConfigService,
public config: ConfigService
) {}

setCurrentZh(zh: any) {
Expand Down Expand Up @@ -47,7 +47,7 @@ export class ZhDataService {

autocompletBib(search_title: string) {
return this._api.get<any>(
`${this.config.API_ENDPOINT}/zones_humides/references/autocomplete?search_title=${search_title}`,
`${this.config.API_ENDPOINT}/zones_humides/references/autocomplete?search_title=${search_title}`
);
}

Expand All @@ -57,7 +57,7 @@ export class ZhDataService {

getHabitatByCorine(corineId: string) {
return this._api.get<any>(
`${this.config.API_ENDPOINT}/zones_humides/forms/cahierhab/${corineId}`,
`${this.config.API_ENDPOINT}/zones_humides/forms/cahierhab/${corineId}`
);
}

Expand All @@ -72,7 +72,7 @@ export class ZhDataService {
map((municipalities: any) => {
municipalities.map((item) => (item.disabled = false));
return municipalities;
}),
})
);
}

Expand All @@ -82,7 +82,7 @@ export class ZhDataService {

getZhDetails(zhId: number) {
return this._api.get<DetailsModel>(
`${this.config.API_ENDPOINT}/zones_humides/${zhId}/complete_card`,
`${this.config.API_ENDPOINT}/zones_humides/${zhId}/complete_card`
);
}

Expand All @@ -107,7 +107,7 @@ export class ZhDataService {
postMainPicture(zhId: number, mediaId: number) {
return this._api.patch(
`${this.config.API_ENDPOINT}/zones_humides/${zhId}/main_pict/${mediaId}`,
{},
{}
);
}

Expand All @@ -117,7 +117,7 @@ export class ZhDataService {

getHierZh(zhId: string) {
return this._api.get<HierarchyModel>(
`${this.config.API_ENDPOINT}/zones_humides/${zhId}/hierarchy`,
`${this.config.API_ENDPOINT}/zones_humides/${zhId}/hierarchy`
);
}

Expand Down
12 changes: 6 additions & 6 deletions frontend/app/zh-forms/tabs/tab1/zh-form-tab1.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class ZhFormTab1Component implements OnInit {
private _tabService: TabsService,
private _error: ErrorTranslatorService,
public ngbModal: NgbModal,
private _config: ConfigService,
private _config: ConfigService
) {}

ngOnInit() {
Expand Down Expand Up @@ -168,7 +168,7 @@ export class ZhFormTab1Component implements OnInit {
this._toastr.error(frontMsg, '', {
positionClass: 'toast-top-right',
});
},
}
);
}
}
Expand All @@ -182,13 +182,13 @@ export class ZhFormTab1Component implements OnInit {
map((res: any) =>
res.filter((r) => {
return !this.listBib.map((bib) => bib.id_reference).includes(r.id_reference);
}),
})
),
catchError(() => {
return of([]);
}),
),
),
})
)
)
);

formatter = (result: any) => `${result.title}`;
Expand Down
8 changes: 4 additions & 4 deletions frontend/app/zh-forms/tabs/tab3/zh-form-tab3.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,8 +469,8 @@ export class ZhFormTab3Component implements OnInit {
a.human_activity.mnemonique.slice(0, 2) > b.human_activity.mnemonique.slice(0, 2)
? 1
: b.human_activity.mnemonique.slice(0, 2) > a.human_activity.mnemonique.slice(0, 2)
? -1
: 0
? -1
: 0
);
}

Expand All @@ -480,8 +480,8 @@ export class ZhFormTab3Component implements OnInit {
a.mnemonique.slice(0, 2) > b.mnemonique.slice(0, 2)
? 1
: b.mnemonique.slice(0, 2) > a.mnemonique.slice(0, 2)
? -1
: 0
? -1
: 0
);
}
return impacts;
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/zh-forms/tabs/tab5/zh-form-tab5.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1162,8 +1162,8 @@ export class ZhFormTab5Component implements OnInit {
a.function.mnemonique.slice(0, 2) > b.function.mnemonique.slice(0, 2)
? 1
: b.function.mnemonique.slice(0, 2) > a.function.mnemonique.slice(0, 2)
? -1
: 0
? -1
: 0
);
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/app/zh-forms/tabs/tab6/zh-form-tab6.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,8 +1041,8 @@ export class ZhFormTab6Component implements OnInit {
a.area.municipality_name > b.area.municipality_name
? 1
: b.area.municipality_name > a.area.municipality_name
? -1
: 0
? -1
: 0
);
}

Expand Down

0 comments on commit b5cd61f

Please sign in to comment.