Porównaj commity

...

3 Commity

Autor SHA1 Wiadomość Data
Hartmut Holzgraefe d7972606e1 better paper size parameter checking 2023-10-31 00:52:59 +00:00
Hartmut Holzgraefe 2a3c3f9f2c whitespace 2023-10-31 00:52:52 +00:00
Hartmut Holzgraefe 7cc0430fda replace one more case of hardcoded ocitysmap path 2023-10-31 00:22:54 +00:00
3 zmienionych plików z 11 dodań i 10 usunięć

Wyświetl plik

@ -190,13 +190,15 @@ def _jobs_post(request):
job.paper_width_mm = 210
job.paper_height_mm = 297
# TODO: either both or none of width/height need to be set
# TODO: size and width/height are mutually exclusive
if 'paper_width' in input:
job.paper_width_mm = input['paper_width']
if 'paper_height' in input:
job.paper_height_mm = input['paper_height']
if 'paper_size' in input:
if 'paper_width' in input or 'paper_height' in input:
if 'paper_size' in input:
result['error']['paper_size'] = "paper_size and paper_width/height are mutually exclusive"
elif 'paper_width' in input and 'paper_height' in input:
job.paper_width_mm = input['paper_width']
job.paper_height_mm = input['paper_height']
else:
result['error']['paper_width'] = "both paper_width and paper_height need to be given"
elif 'paper_size' in input:
try:
_ocitysmap = ocitysmap.OCitySMap(www.settings.OCITYSMAP_CFG_PATH)
p = _ocitysmap.get_paper_size_by_name(input['paper_size'])

Wyświetl plik

@ -208,7 +208,7 @@ class MapRenderingJobForm(forms.ModelForm):
if mode == 'admin':
# TODO as bounding box override now exists (Issue #24)
# we need to do the same bbox checks here as in
# the mode=bbox section below?
# the mode=bbox section below?
if city == "":
msg = _(u"Administrative city required")
self._errors["administrative_city"] = ErrorList([msg])

Wyświetl plik

@ -195,8 +195,7 @@ LANGUAGE_FLAGS = {
LOCALE_PATHS = [
os.path.join(PROJECT_PATH, 'locale'),
# TODO ocitysmap path should not be hardcoded
os.path.join('/home/maposmatic/ocitysmap', 'locale'),
os.path.join(OCITYSMAP_PATH, 'locale'),
]
# Associate a Django language code with: