Commit Graph

28221 Commits

Author SHA1 Message Date
Yashashvi Dave 583fde4311 custom profile field: Set default values in create-field form on load.
Add call of reset function, on load of admin settings page.
This function reset values in create-new-field form, i.e.
field type.
2018-08-21 11:42:59 -07:00
Yashashvi Dave 03f5422ce8 custom profile field: Minor tweaks in field-table in admin settings.
This commit add minor changes in profile field table in
admin settings:
 - Hide table header if there is no field
 - Fix width of table column
2018-08-21 11:42:59 -07:00
Yashashvi Dave 66c2b6d2a6 custom profile field: Remove unnecessary table header from edit form.
Remove unnecessary table header in edit-choice-field form.
2018-08-21 11:42:58 -07:00
Yashashvi Dave d5f3c9b3bc custom profile field: Rename field types in UI. 2018-08-21 11:37:51 -07:00
Yashashvi Dave 463fb622b6 custom profile field: Remove all static use of field-type name or id.
This commit removes all static use of field-type's name or id in
frontend.
2018-08-21 11:37:51 -07:00
Yashashvi Dave 6e65235a6d zerver/lib/events.py: Add FIELD_TYPE_CHOICES_DICT to page_params.
This commit add FIELD_TYPE_CHOICES_DICT to page_params and replace
FIELD_TYPE_CHOICES.

FIELD_TYPE_CHOICES_DICT includes all field types with keyword, id
and display name. Using this field-type-dict, we can access field
type information by it's keyword, and remove all static use of
field-type'a name or id in frontend.
This commit also modifies functions in js where this page_params
field-types is used.
2018-08-21 11:37:51 -07:00
Yashashvi Dave 621a5cdc35 zerver/models.py: Modify FIELD_TYPE_DATA, add keyword for field type.
This commit modifies FIELD_TYPE_DATA dict in `CustomProfileField`
model to store keyword of field types. And create new dict
FIELD_TYPE_CHOICES_DICT to store all field type information
by field type keyword, i.e. id, name.

This is preparatory commit to remove all static use of field
types in frontend and access field type with keyword instead
of display name.
2018-08-21 11:37:51 -07:00
Tim Abbott 24f3419449 postgres-init-db: Throw an error if not run as root.
Fixes part of the dicsussion in #552.
2018-08-21 11:36:50 -07:00
Max Nussenbaum eaefa31969 portico: Fix mis-sized bullets.
This fixes the mis-sized text in the bulleted lists on /for/
working-groups-and-communities (and some other pages), by ensuring
p tags inside li tags don't get font-size styling applied to them
twice.
2018-08-21 11:34:39 -07:00
Rishi Gupta a04d1e3d98 docs: Update intros to production install pages.
We should cut to the chase where we can.
2018-08-21 11:32:16 -07:00
Steve Howell a6bc3886e6 refactor: Extract send_peer_remove_event().
This prevents leaking some variables into an already
cluttered function.

We also add test coverage for what's now an
early-exit condition in the new function--we exempt
public MIT streams from these events.
2018-08-21 11:23:40 -07:00
Steve Howell 092bb6a728 tests: Refactor test_bulk_subscribe_MIT().
We extract a couple local vars to avoid
repeating ourself.

We also explictly set the stream as a zephyr stream.
2018-08-21 11:23:40 -07:00
Steve Howell e7062b77c8 tests: Test superuser can also mirror to private streams.
This extends a test that proved only what Cordelia
could do with/without super_user privileges when she
was trying to send to an unsubscribed stream as herself.

Now the test shows the same powers extend to Cordelia
when she's sending messages on behalf of a mirrored
user.
2018-08-21 11:23:40 -07:00
Steve Howell aee46bb1e9 tests: Test forging timestamps for mirrored messages. 2018-08-21 11:23:40 -07:00
Steve Howell 79fb36c599 refactor: Extract maybe_add_event() function.
This change was partially driven by a quirk in Python
where peephole optimizations make `continue` lines
appear not to be covered.

I also think it's generally a good idiom to extract
functions for loop bodies when they don't actually
accumulate values or maintain other state.  With this
commit we now prevent potential bugs for vars like
`is_stream` leaking between loop iterations.
2018-08-21 11:23:40 -07:00
Steve Howell e99c0929f0 tests: Test race handling for creating mirror users.
We simulate a race condition by mocking create_user
to actually create a user, but then raise an
IntegrityError (as if another process had actually
created the user, not our test).

I also changed the real code to use explicitly
named parameters.
2018-08-21 11:23:40 -07:00
Tim Abbott 0068a5ccd6 events: Fix can_subscribe_other_users not being set properly.
I don't understand why this didn't cause test failures in CI; this
change was clearly required and test_change_realm_property was failing
consistently for me locally.
2018-08-21 11:20:59 -07:00
Yago González 6949ce1bad templates: Replace   with normal spaces.
This line full of non-breaking spaces dates back to before Zulip being
open sourced (ca4e6a0ff), so we can assume it was a fix that we don't
need anymore.
2018-08-21 11:13:47 -07:00
Rishi Gupta 99b55b712b user docs: Shorten instructions when using relative settings links. 2018-08-20 21:26:01 -07:00
Rishi Gupta 36d495736a user docs: Rename display-emoji-as-text. 2018-08-20 19:24:36 -07:00
Rishi Gupta 33c586d3ec user docs: Update enable-emoticon-translations. 2018-08-20 19:24:36 -07:00
Rishi Gupta 2df6662d8c docs: Add clarification for help wanted and good first issue labels. 2018-08-20 19:17:47 -07:00
Rishi Gupta 9a759060cd user docs: Remove outdated app guides. 2018-08-20 18:52:04 -07:00
Rishi Gupta 1f2ed31791 user docs: Add related articles to desktop install guide. 2018-08-20 18:22:30 -07:00
Rishi Gupta 0f44d380ca user docs: Update save-changes.md. 2018-08-20 17:11:53 -07:00
Lyla Fischer 43f2a99f2a user docs: Trim change-a-users-name. 2018-08-20 17:11:53 -07:00
Lyla Fischer f3324f9748 user docs: Trim make-a-user-an-administrator. 2018-08-20 17:11:53 -07:00
Tim Abbott 6827c42e02 migrations: Fix accounting in is_private migration.
The previous logic didn't correctly handle the case of total being 0.

Fixes #10378.
2018-08-20 16:49:08 -07:00
Lyla Fischer f4d1283b6c user docs: Update deactivate-or-reactivate-a-bot. 2018-08-20 15:50:16 -07:00
Lyla Fischer 172cde6af6 user docs: Add restrict-bot-creation. 2018-08-20 15:50:16 -07:00
Lyla Fischer 603dedbfec user docs: Update set-default-streams-for-new-users. 2018-08-20 15:02:39 -07:00
Lyla Fischer 614da57f8a user docs: Update add-or-remove-users-from-a-stream. 2018-08-20 15:02:39 -07:00
Lyla Fischer c183c5059e user docs: Update change-the-privacy-of-a-stream. 2018-08-20 15:02:39 -07:00
Lyla Fischer f79614a7dd user docs: Update change-stream-description. 2018-08-20 15:02:39 -07:00
Lyla Fischer f1462d096e user docs: Update rename-a-stream. 2018-08-20 15:02:39 -07:00
Lyla Fischer 6fc214929c user docs: Update delete-a-stream. 2018-08-20 15:02:39 -07:00
Abhilash Verma 0e2322a322 logging: Show timestamp in UTC in non-django production scripts.
Done in pair programming with @aero31aero.

Fixes #9678.
2018-08-20 12:52:40 -07:00
Rohitt Vashishtha 920ef2b7f7 bugdown: Add mention_data.get_user_by_id().
This will allow us to do the lookups required to support the upcoming
`@**name|id**` syntax.
2018-08-20 12:46:46 -07:00
Rohitt Vashishtha 8a61ac3500 typeahead: Move displaced comment to correct location. 2018-08-20 12:44:24 -07:00
Tim Abbott 972e1d2d8b ldap: Improve exception handling in user data sync tool.
At some point, the most likely exception here stopped being
IntegrityError.

Fixes #9218.
2018-08-20 10:40:53 -07:00
Tim Abbott 3cfb2000cc ldap: Improve error message for username/LDAP domain mismatches. 2018-08-20 10:39:34 -07:00
Rhea Parekh f70b9a3eba import: Move 'build_message' to import_util. 2018-08-19 22:27:13 -07:00
Rhea Parekh 53e9da8e1f import: Build CustomProfileField, CustomProfileFieldValue and RealmEmoji with model class. 2018-08-19 22:27:13 -07:00
Rhea Parekh d98a5925cb import: Build Reaction with the model class. 2018-08-19 22:27:13 -07:00
Rhea Parekh a5bc701181 import: Move 'build_stream' to import_util. 2018-08-19 22:27:13 -07:00
Rhea Parekh c4f8abbd30 import: Build Message with the model class. 2018-08-19 22:27:13 -07:00
Rhea Parekh 4ea7302e14 import: Add missing fields in UserProfile object.
The missing fields are checked by `full_clean()` method.
The datetime field errors are ignored as they are fixed
in the `import_realm` script. The field that are
allowed to be null are not included while building
this object.
2018-08-19 22:27:13 -07:00
Rhea Parekh 66d34b23ef import: Build Attachment with the model class. 2018-08-19 22:27:13 -07:00
Rhea Parekh 9617b1fbc5 import: Build Recipient and Subscription with model class. 2018-08-19 22:27:13 -07:00
Rhea Parekh c77763bd8e import: Move 'build_realm' to import_util. 2018-08-19 22:27:13 -07:00