mirror of
https://github.com/erpnext/foundation.git
synced 2026-10-16 18:00:47 +02:00
Merge pull request #42 from vishdha/issue_10625
[fix] Message appeared when user forget to add title on Job Portal
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
|
from frappe import _
|
||||||
from frappe.website.website_generator import WebsiteGenerator
|
from frappe.website.website_generator import WebsiteGenerator
|
||||||
import foundation
|
import foundation
|
||||||
|
|
||||||
@@ -17,6 +18,9 @@ class PortalJob(WebsiteGenerator):
|
|||||||
def validate(self):
|
def validate(self):
|
||||||
if not self.route:
|
if not self.route:
|
||||||
self.route = 'erpnext-jobs/' + self.scrub(self.title)
|
self.route = 'erpnext-jobs/' + self.scrub(self.title)
|
||||||
|
if not self.title:
|
||||||
|
frappe.throw(_("Job Title is Mandatory for posting a job"))
|
||||||
|
|
||||||
|
|
||||||
def get_list_context(context):
|
def get_list_context(context):
|
||||||
context.allow_guest = True
|
context.allow_guest = True
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
/* eslint-disable */
|
||||||
|
// rename this file from _test_[name] to test_[name] to activate
|
||||||
|
// and remove above this line
|
||||||
|
|
||||||
|
QUnit.test("test: Portal Job", function (assert) {
|
||||||
|
let done = assert.async();
|
||||||
|
|
||||||
|
// number of asserts
|
||||||
|
assert.expect(1);
|
||||||
|
let done = assert.async();
|
||||||
|
frappe.run_serially([
|
||||||
|
// insert a new Portal Job
|
||||||
|
() => {
|
||||||
|
return frappe.tests.make('Portal Job', [
|
||||||
|
// values to be set
|
||||||
|
{title: 'test123'},
|
||||||
|
{company_name:'Test Company'},
|
||||||
|
{status:'Open'},
|
||||||
|
{description:'Test Content'},
|
||||||
|
{contact_number:'123456789'},
|
||||||
|
{route:'test'}
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
() => cur_frm.save(),
|
||||||
|
() => {
|
||||||
|
assert.equal(cur_frm.doc.title, 'test123');
|
||||||
|
},
|
||||||
|
() => done()
|
||||||
|
]);
|
||||||
|
});
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"is_standard": 1,
|
"is_standard": 1,
|
||||||
"login_required": 1,
|
"login_required": 1,
|
||||||
"max_attachment_size": 0,
|
"max_attachment_size": 0,
|
||||||
"modified": "2017-03-02 12:09:51.793675",
|
"modified": "2017-08-31 16:58:13.787406",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "ERPNext Foundation",
|
"module": "ERPNext Foundation",
|
||||||
"name": "jobs",
|
"name": "jobs",
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
"max_length": 0,
|
"max_length": 0,
|
||||||
"max_value": 0,
|
"max_value": 0,
|
||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"reqd": 0
|
"reqd": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "job_type",
|
"fieldname": "job_type",
|
||||||
|
|||||||
Reference in New Issue
Block a user