mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 10:31:50 +01:00
Allow setting price-type to NOT_APPLICABLE. Addresses #52
This commit is contained in:
@@ -240,8 +240,9 @@ class KleinanzeigenBot(SeleniumMixin):
|
||||
assert_one_of("type", ("OFFER", "WANTED"))
|
||||
assert_min_len("title", 10)
|
||||
assert_has_value("description")
|
||||
assert_has_value("price")
|
||||
assert_one_of("price_type", ("FIXED", "NEGOTIABLE", "GIVE_AWAY"))
|
||||
assert_one_of("price_type", ("FIXED", "NEGOTIABLE", "GIVE_AWAY", "NOT_APPLICABLE"))
|
||||
if ad_cfg["price_type"] != "NOT_APPLICABLE":
|
||||
assert_has_value("price")
|
||||
assert_one_of("shipping_type", ("PICKUP", "SHIPPING", "NOT_APPLICABLE"))
|
||||
assert_has_value("contact.name")
|
||||
assert_has_value("republication_interval")
|
||||
@@ -415,9 +416,11 @@ class KleinanzeigenBot(SeleniumMixin):
|
||||
#############################
|
||||
# set price
|
||||
#############################
|
||||
self.web_select(By.XPATH, "//select[@id='priceType']", ad_cfg["price_type"])
|
||||
if ad_cfg["price_type"] != "GIVE_AWAY":
|
||||
self.web_input(By.ID, "pstad-price", ad_cfg["price"])
|
||||
price_type = ad_cfg["price_type"]
|
||||
if price_type != "NOT_APPLICABLE":
|
||||
self.web_select(By.XPATH, "//select[@id='priceType']", price_type)
|
||||
if price_type != "GIVE_AWAY":
|
||||
self.web_input(By.ID, "pstad-price", ad_cfg["price"])
|
||||
|
||||
#############################
|
||||
# set description
|
||||
|
||||
@@ -5,7 +5,7 @@ description:
|
||||
category:
|
||||
special_attributes: {}
|
||||
price:
|
||||
price_type: # one of: FIXED, NEGOTIABLE, GIVE_AWAY
|
||||
price_type: # one of: FIXED, NEGOTIABLE, GIVE_AWAY, NOT_APPLICABLE
|
||||
shipping_type: # one of: PICKUP, SHIPPING, NOT_APPLICABLE
|
||||
shipping_costs:
|
||||
images: []
|
||||
|
||||
@@ -10,7 +10,7 @@ ad_defaults:
|
||||
description:
|
||||
prefix: ""
|
||||
suffix: ""
|
||||
price_type: NEGOTIABLE # one of: FIXED, NEGOTIABLE, GIVE_AWAY
|
||||
price_type: NEGOTIABLE # one of: FIXED, NEGOTIABLE, GIVE_AWAY, NOT_APPLICABLE
|
||||
shipping_type: SHIPPING # one of: PICKUP, SHIPPING, NOT_APPLICABLE
|
||||
contact:
|
||||
name: ""
|
||||
|
||||
Reference in New Issue
Block a user