
132 Cal.App.3d 869 (1982)
183 Cal. Rptr. 466
JOSEPH A. GALLIGAN, Plaintiff and Appellant,
v.
CITY OF SAN BRUNO, Defendant and Respondent.
Docket No. 48192.
Court of Appeals of California, First District, Division Four.
June 16, 1982.
*871 COUNSEL
Patrick T. Galligan and Galligan & Biscay for Plaintiff and Appellant.
David W. Lennihan, Jared Dreyfus, Robert M. Chilvers and Brobeck, Phleger & Harrison for Defendant and Respondent.
OPINION
CHRISTIAN, J.
Joseph A. Galligan, City Attorney of the City of San Bruno, appeals from a judgment on the pleadings denying declaratory *872 relief and a writ of mandate. Appellant sought to have the court determine the invalidity of a city ordinance purporting to remove the office of city attorney from the city's civil service system. Appellant alleged that the ordinance was invalid in that the position of city attorney was part time and as such could not be removed from civil service by a majority vote of the city council. Respondent city answered and moved for judgment on the pleadings.
(1) Reviewing a judgment on the pleadings dismissing a complaint, we accept as true the allegations of the complaint. (Board of Regents v. Davis (1975) 14 Cal.3d 33, 37, fn. 4 [120 Cal. Rptr. 407, 533 P.2d 1047]; Fosgate v. Gonzales (1980) 107 Cal. App.3d 951, 957 [166 Cal. Rptr. 233]; Tiffany v. Sierra Sands Unified School Dist. (1980) 103 Cal. App.3d 218, 222-223 [162 Cal. Rptr. 669].)
Appellant alleged that in 1946 the city council established by ordinance a civil service system applicable to all city offices, positions and employees except elective offices, appointive positions and certain police personnel. The ordinance included in the civil service system the position of city attorney.
Appellant was appointed city attorney; he became a permanent civil service employee in June of 1958. In August of 1958 a new ordinance excluded part-time employees, the city manager and the city manager's secretary, from the civil service system. The new ordinance contained a "grandfather clause" allowing persons who had already attained permanent civil service status to retain that status in spite of the additional exceptions. By virtue of this grandfather clause, appellant, a part-time employee, retained his previously acquired civil service status.
In 1960, another ordinance additionally excluded from the civil service system the following: "All employees in the office of the City Attorney, including any assistants, secretaries, or clerical personnel." The city attorney himself remained subject to the civil service system.
In October of 1978, the city council adopted a resolution which purported to (a) eliminate the position of city attorney from the city's civil service classification system and (b) approve and adopt a position description for the office of city attorney which described the position as exempt and further stated that "no outside practice shall be permitted without specific approval of the City Council."
*873 A few weeks later, the ordinance now under challenge removed the position of city attorney from civil service effective January 1, 1979. Specifically, the ordinance provided that "all employees in the office of City Attorney, including the City Attorney, any assistants, secretaries or clerical personnel" would be excepted from civil service coverage. (Italics added.)
(2) Appellant contends that the attempt of the city council to withdraw the position of city attorney from civil service was ineffective. A city council may, by a majority vote, withdraw from civil service any "regular full time city department heads.... [Other withdrawals must be] submitted to the city electors at a special or regular municipal election and approved by two-thirds of those voting on the proposition, ..." (Gov. Code, § 45007.) Appellant argues that since the position of city attorney is part time, it can be excluded from the civil service system only by a two-thirds vote at a municipal election.
In determining the validity of an ordinance or a statute, the presumption is that the enactment is valid. (City of Industry v. Willey (1970) 11 Cal. App.3d 658, 663 [89 Cal. Rptr. 922]; see 45 Cal.Jur.3d, Municipalities, § 205 pp. 323-324.) "`... "Where ordinances or bylaws have been enacted pursuant to competent authority they will be supported by every reasonable intendment and reasonable doubts as to their validity will be resolved in their favor. Courts are bound to uphold municipal ordinances and bylaws unless they manifestly transcend the powers of the enacting body."'" (Brown v. City of Berkeley (1976) 57 Cal. App.3d 223, 231 [129 Cal. Rptr. 1]; Acton v. Henderson (1957) 150 Cal. App.2d 1, 14 [309 P.2d 481].)
Essentially, appellant claims that the resolution was invalid in that it purported to remove a position which was not that of a "full time department head" from civil service by a vote of the city council; appellant asserts that this action was barred by the provisions of Government Code section 45007. Appellant argues that the proper procedures to be followed are: "If a department head is part-time, a city council must change the position to full-time. After the department head becomes full-time, the city council can then remove the position from civil service."
Effectively the city council complied with the steps which appellant argues are required. The October resolution changed the position of city attorney from part time to full time and, simultaneously, exempted that *874 position from civil service. Thus, the city council has taken both actions which appellant asserts were required; appellant's complaint is essentially that the enactments were passed concurrently rather than consecutively. But appellant has not shown why concurrent action is improper. We conclude that the statute does not preclude concurrent actions.
The actions of the city council can also be construed as meeting appellant's claimed requirement of consecutive action. The resolution which changed the position description for city attorney from part time to full time was effective immediately when passed in October of 1978; the San Bruno City Code provides that the city council may, by resolution, adopt, amend and revise personnel rules pertaining to the civil service system. (San Bruno City Code, § 18-12.) The same resolution, insofar as it attempted to exempt the position from civil service, was ineffective because only a new ordinance could amend the provision of the city code affecting the tenure of the city attorney. The ordinance now under challenge was adopted in November of 1978, but did not become effective until January 1, 1979. Thus, the city council first made the position full time by the October 1978 resolution, and subsequently exempted the position from civil service in November, 1978, by ordinance No. 1311.
Implicit in this analysis is the assumption that the invalid portion of the resolution, which removed the position of city attorney from civil service, was severable from the valid portion which made that position full time. "Separable invalid parts of an ordinance will not invalidate parts that are valid.... The test of the severability of an invalid part of an ordinance from the remainder is whether the invalid part can be severed without destroying the legislative scheme, or the utility of the remaining provisions." (45 Cal.Jur.3d, Municipalities, § 203, pp. 321-322.) The same reasoning applies to a municipal resolution. It appears that the city council by its adoption of the resolution and ordinance in question intended to change the position of city attorney from a civil service part-time position to a full time noncivil service post. Severing the invalid portion of the resolution would not destroy the legislative scheme but on the contrary would further the intent of the legislative body.
(3) "[W]ith respect to a municipal ordinance, `Every intendment is to be indulged in favor of its validity, and ... the court must, in deference *875 to the legislative act, adopt the construction which will give effect to the obvious legislative purpose.'" (City of Industry v. Willey, supra, 11 Cal. App.3d 658, 663.) Applying the above canons of construction to the enactments at issue in the present case, the trial court's determination of the validity of those enactments must be upheld.
The court dismissed appellant's complaint by ruling in respondent's favor on its motion for judgment on the pleadings. (4) It is improper to decide the merits of a properly pleaded declaratory relief suit by dismissal. (VTN Consolidated, Inc. v. Northbrook Ins. Co. (1979) 92 Cal. App.3d 888, 893 [155 Cal. Rptr. 172]; 3 Witkin, Cal. Procedure (1981 supp.) Pleading, § 730, p. 185.) While the dismissal of the action was erroneous, reversal of the judgment on that ground alone would serve no useful purpose. The appellate court may instead modify the judgment of dismissal so as to declare that appellant is entitled to no relief under the allegations of his complaint. (Id.; Berkeley v. Alameda County Bd. of Supervisors (1974) 40 Cal. App.3d 961, 964 [115 Cal. Rptr. 540].) In the present case, however, reversal is necessary on another ground; therefore it is appropriate to leave it to the trial court to render in due course a judgment declaring the rights of the parties.
(5) Finally, appellant contends that the denial of his request to amend the complaint was error. Appellant's request for leave to amend was contained in the conclusion to his "Supplemental Memorandum of Points and Authorities in Support of Plaintiff's Motion for Summary Judgment." Although the request was never explicitly denied by the court below, appellant contends that by giving judgment for respondent, the trial court "thereby denied [appellant's] request."
Appellant originally pleaded bad faith on the part of the city council as an affirmative defense to respondent's cross-complaint. (See Trujillo v. City of Los Angeles (1969) 276 Cal. App.2d 333 [81 Cal. Rptr. 146] [bad faith removal of civil service employee by abolishing position]; Rexstrew v. City of Huntington Park (1942) 20 Cal.2d 630, 633 [128 P.2d 23] ["The power to abolish a position may not be used to effect the discharge of an employee protected by the salutary provisions of civil service regulations, unless such power is exercised in good faith"].) appellant contends that the trial court erred in not allowing him to amend his complaint to include this bad faith cause of action.
*876 Appellant cites MacIsaac v. Pozzo (1945) 26 Cal.2d 809 [161 P.2d 449], in support of this argument. In MacIsaac, the court indicated that a motion for judgment on the pleadings should not be granted without first allowing the party an opportunity to elect whether he will stand on his pleadings or amend them. (MacIsaac v. Pozzo, supra, 26 Cal.2d 809, 816.) This statement was not absolute; it was qualified as follows: "`If plaintiff has a good cause of action, which by accident or mistake he has failed to set out in his complaint, the court, on motion for judgment on the pleadings, should, on his application so to do, permit him to amend.' ... The granting of the motion without leave to amend would in many cases be an absolute denial of justice, and is directly opposed to the policy of the law that cases should be tried and decided on the merits." (MacIsaac v. Pozzo, supra, 26 Cal.2d 809, 815-816; italics added.)
This view has been reiterated in a more recent decision in which it was stated that: a "motion for judgment on the pleadings must be granted where no cause of action exists in the context of the facts as pleaded [citation]. If the complaint could be amended to state a cause of action, leave should be granted to allow plaintiff to do so [citation]." (Wagner v. Benson (1980) 101 Cal. App.3d 27, 32 [161 Cal. Rptr. 516]; Scott v. City of Indian Wells (1972) 6 Cal.3d 541, 550 [99 Cal. Rptr. 745, 492 P.2d 1137].)
Similarly, an appellant may properly assert for the first time on appeal that a court abused its discretion in sustaining a demurrer without leave to amend. (Code Civ. Proc., § 472c.) The code "does not require a specific request to amend, or an indication of its legal basis, as a prerequisite for reviewing the trial court's order on appeal." (Nestle v. City of Santa Monica (1972) 6 Cal.3d 920, 939 [101 Cal. Rptr. 568, 496 P.2d 480]. But see Tiffany v. Sierra Sands Unified School Dist., supra, 103 Cal. App.3d 218, 226 ["no abuse of discretion occurs when the plaintiff fails to indicate the nature of the proposed amendment or the manner in which he would amend his complaint"]. This rationale applies equally to the granting of a motion for judgment on the pleadings since it is treated as a demurrer for purposes of appeal. Appellant should be given an opportunity to plead a cause of action (as distinguished from an affirmative defense) for bad faith actions designed to circumvent the protections of the civil service system.
*877 The judgment is reversed with directions to permit appellant to amend his complaint.
Caldecott, P.J., and Poche, J., concurred.
