Realm.py: Refactor and remove duplicate code.
Realm.py: Refactor and remove duplicate code.

Moved error handling to the beginning of the update_realm
function. Removed several if statements and replaced them with
a block of code that loops through realm properties and updates
them if an update has been sent through the request. Also
created an 'exclude' list for realm properties that do not fit
into the general pattern that most other realm properties
follow for updating. Those properties are handled separately.

Some comments added by tabbott.

Addresses part of issue #3854.

mahim97/zulip,vaidap/zulip,brockwhittaker/zulip,kou/zulip,SmartPeople/zulip,rishig/zulip,amanharitsh123/zulip,Galexrt/zulip,jphilipsen05/zulip,punchagan/zulip,brockwhittaker/zulip,SmartPeople/zulip,hackerkid/zulip,timabbott/zulip,christi3k/zulip,ryanbackman/zulip,brainwane/zulip,verma-varsha/zulip,tommyip/zulip,ryanbackman/zulip,tommyip/zulip,tommyip/zulip,jphilipsen05/zulip,jackrzhang/zulip,jphilipsen05/zulip,jrowan/zulip,zulip/zulip,jackrzhang/zulip,verma-varsha/zulip,zulip/zulip,zulip/zulip,showell/zulip,timabbott/zulip,mahim97/zulip,showell/zulip,punchagan/zulip,showell/zulip,brainwane/zulip,rht/zulip,rht/zulip,j831/zulip,kou/zulip,christi3k/zulip,kou/zulip,synicalsyntax/zulip,shubhamdhama/zulip,vaidap/zulip,andersk/zulip,vabs22/zulip,tommyip/zulip,eeshangarg/zulip,amanharitsh123/zulip,vabs22/zulip,dhcrzf/zulip,tommyip/zulip,Galexrt/zulip,jphilipsen05/zulip,rishig/zulip,vabs22/zulip,eeshangarg/zulip,brainwane/zulip,shubhamdhama/zulip,andersk/zulip,vaidap/zulip,synicalsyntax/zulip,eeshangarg/zulip,verma-varsha/zulip,christi3k/zulip,zulip/zulip,shubhamdhama/zulip,christi3k/zulip,hackerkid/zulip,vabs22/zulip,dhcrzf/zulip,andersk/zulip,kou/zulip,andersk/zulip,vaidap/zulip,eeshangarg/zulip,rishig/zulip,brockwhittaker/zulip,brainwane/zulip,ryanbackman/zulip,SmartPeople/zulip,christi3k/zulip,timabbott/zulip,eeshangarg/zulip,hackerkid/zulip,mahim97/zulip,brockwhittaker/zulip,j831/zulip,timabbott/zulip,jphilipsen05/zulip,Galexrt/zulip,kou/zulip,vaidap/zulip,j831/zulip,rishig/zulip,rishig/zulip,punchagan/zulip,timabbott/zulip,mahim97/zulip,timabbott/zulip,vabs22/zulip,shubhamdhama/zulip,jackrzhang/zulip,SmartPeople/zulip,rht/zulip,hackerkid/zulip,synicalsyntax/zulip,rht/zulip,amanharitsh123/zulip,showell/zulip,punchagan/zulip,jrowan/zulip,zulip/zulip,punchagan/zulip,brainwane/zulip,dhcrzf/zulip,zulip/zulip,mahim97/zulip,rishig/zulip,SmartPeople/zulip,showell/zulip,brockwhittaker/zulip,Galexrt/zulip,jackrzhang/zulip,brainwane/zulip,jrowan/zulip,dhcrzf/zulip,eeshangarg/zulip,synicalsyntax/zulip,jrowan/zulip,hackerkid/zulip,kou/zulip,mahim97/zulip,vaidap/zulip,Galexrt/zulip,zulip/zulip,tommyip/zulip,ryanbackman/zulip,shubhamdhama/zulip,shubhamdhama/zulip,andersk/zulip,rht/zulip,verma-varsha/zulip,amanharitsh123/zulip,andersk/zulip,punchagan/zulip,eeshangarg/zulip,verma-varsha/zulip,amanharitsh123/zulip,Galexrt/zulip,synicalsyntax/zulip,ryanbackman/zulip,hackerkid/zulip,brainwane/zulip,andersk/zulip,timabbott/zulip,jphilipsen05/zulip,showell/zulip,jackrzhang/zulip,showell/zulip,punchagan/zulip,jrowan/zulip,synicalsyntax/zulip,j831/zulip,dhcrzf/zulip,amanharitsh123/zulip,brockwhittaker/zulip,jrowan/zulip,jackrzhang/zulip,tommyip/zulip,j831/zulip,shubhamdhama/zulip,Galexrt/zulip,rishig/zulip,dhcrzf/zulip,j831/zulip,verma-varsha/zulip,rht/zulip,synicalsyntax/zulip,dhcrzf/zulip,rht/zulip,hackerkid/zulip,vabs22/zulip,christi3k/zulip,kou/zulip,jackrzhang/zulip,ryanbackman/zulip,SmartPeople/zulip