discourse/app/models
Blake Erickson 67dec38f31 FIX: Gravatar download attempt if user is missing their email
It is possible that a user could exist without an email, if so we should
not enqueue a job to download their gravatar.

This commit resolves this error that can occur:

```
Job exception: undefined method `email' for nil:NilClass
/var/www/discourse/app/models/user.rb:1204:in `email'
/var/www/discourse/app/jobs/regular/update_gravatar.rb:12:in `execute'
```

This commit also fixes the original spec which actually was wrong. The
job never enqueued in the original spec and so the gravatar was never
actually updated and the test was checking if the two values were the
same, but they were both null and never updated, so of course they were
the same!

A new test has also been added to make sure the gravatar job isn't
enqueued when a user's email is missing.
2020-09-02 20:19:46 -06:00
..
concerns Accounted for the change while reading the fields added specs to confirm working 2020-08-25 09:52:18 -04:00
reports
about.rb
admin_dashboard_data.rb
admin_dashboard_general_data.rb
admin_dashboard_index_data.rb
allowed_pm_user.rb
anonymous_user.rb
api_key_scope.rb FEATURE: More API scopes (#10493) 2020-08-24 12:15:08 -03:00
api_key.rb
application_request.rb
auto_track_duration_site_setting.rb
backup_draft_post.rb
backup_draft_topic.rb
backup_file.rb
backup_location_site_setting.rb
backup_metadata.rb
badge_grouping.rb
badge_type.rb
badge.rb
base_font_setting.rb FEATURE: Add site setting and wizard step to set base font (#10250) 2020-08-31 13:14:09 +03:00
bookmark.rb
category_and_topic_lists.rb
category_custom_field.rb
category_featured_topic.rb
category_group.rb
category_list.rb
category_page_style.rb
category_search_data.rb
category_tag_group.rb
category_tag_stat.rb
category_tag.rb
category_user.rb FEATURE: add regular_categories field in site setting & user option. (#10477) 2020-08-20 00:35:04 +05:30
category.rb
child_theme.rb
color_scheme_color.rb FIX: Wizard could not send custom color schemes to the client correctly (#10484) 2020-08-20 17:10:33 -07:00
color_scheme_setting.rb
color_scheme.rb Update annotations. 2020-09-01 13:41:04 +05:30
custom_emoji.rb
developer.rb
digest_email_site_setting.rb
directory_item.rb
discourse_single_sign_on.rb
discourse_version_check.rb
draft_sequence.rb
draft.rb
draftable_list.rb
email_change_request.rb
email_level_site_setting.rb
email_log.rb
email_style.rb
email_token.rb
embeddable_host.rb DEV: Update annotations. 2020-08-21 11:36:53 +08:00
embedding.rb
emoji_set_site_setting.rb
emoji.rb
github_user_info.rb
given_daily_like.rb
global_setting.rb
group_archived_message.rb
group_category_notification_default.rb
group_custom_field.rb
group_history.rb
group_manager.rb
group_mention.rb
group_request.rb
group_tag_notification_default.rb
group_user.rb FEATURE: allow group membership to unmute categories and tags 2020-08-13 17:20:53 -04:00
group.rb FIX: System message wasn't fully translatable 2020-09-02 15:24:25 +02:00
ignored_user.rb
imap_sync_log.rb DEV: IMAP log to database (#10435) 2020-08-14 12:01:31 +10:00
incoming_domain.rb
incoming_email.rb
incoming_link.rb
incoming_links_report.rb
incoming_referer.rb
invite_redeemer.rb
invite.rb
invited_group.rb
invited_user.rb
javascript_cache.rb
like_notification_frequency_site_setting.rb
locale_site_setting.rb
mailing_list_mode_site_setting.rb
muted_user.rb
new_topic_duration_site_setting.rb
notification_level_when_replying_site_setting.rb
notification.rb DEV: adds event_reminder (27) and event_invitation (28) (#10473) 2020-08-19 12:07:51 +02:00
oauth2_user_info.rb
onceoff_log.rb
optimized_image.rb
permalink.rb
plugin_store_row.rb
plugin_store.rb
post_action_type.rb
post_action.rb
post_analyzer.rb FIX - limit number of embedded media items in a post (#10391) 2020-08-07 12:08:59 -04:00
post_custom_field.rb
post_detail.rb
post_mover.rb FIX: generate topic excerpt when moving posts to new topic. 2020-08-13 11:30:14 +05:30
post_reply_key.rb
post_reply.rb
post_revision.rb
post_search_data.rb Remove out-of-date / non-core annotations. 2020-09-01 12:40:57 +05:30
post_stat.rb
post_timing.rb
post_upload.rb
post.rb DEV: Replace SECURE_MEDIA_ROUTE const with other methods (#10545) 2020-08-28 11:28:11 +10:00
previous_replies_site_setting.rb
published_page.rb
push_subscription.rb
quoted_post.rb
remote_theme.rb
remove_muted_tags_from_latest_site_setting.rb
report.rb
reviewable_claimed_topic.rb
reviewable_flagged_post.rb Update annotations. 2020-09-01 13:41:04 +05:30
reviewable_history.rb
reviewable_priority_setting.rb
reviewable_queued_post.rb Update annotations. 2020-09-01 13:41:04 +05:30
reviewable_score.rb
reviewable_sensitivity_setting.rb
reviewable_user.rb Update annotations. 2020-09-01 13:41:04 +05:30
reviewable.rb Update annotations. 2020-09-01 13:41:04 +05:30
s3_region_site_setting.rb
screened_email.rb
screened_ip_address.rb
screened_url.rb
search_log.rb
shared_draft.rb
single_sign_on_record.rb
site_setting.rb FEATURE: Dark mode alternative logos (#10441) 2020-08-17 15:43:20 -04:00
site.rb
skipped_email_log.rb
slug_setting.rb
stylesheet_cache.rb
tag_group_membership.rb
tag_group_permission.rb
tag_group.rb
tag_search_data.rb
tag_user.rb
tag.rb FIX: delete unused tags shouldn't delete tags belonging to tag groups 2020-08-19 12:17:49 -04:00
theme_field.rb DEV: Let themes extend color definitions (#10429) 2020-08-18 13:02:13 -04:00
theme_modifier_set.rb
theme_setting.rb
theme_translation_override.rb
theme.rb
top_lists.rb
top_menu_item.rb
top_topic.rb
topic_allowed_group.rb
topic_allowed_user.rb
topic_converter.rb
topic_custom_field.rb Annotate models. 2020-09-01 10:22:32 +05:30
topic_embed.rb
topic_featured_users.rb
topic_group.rb
topic_invite.rb
topic_link_click.rb
topic_link.rb
topic_list.rb
topic_notifier.rb
topic_participants_summary.rb
topic_poster.rb
topic_posters_summary.rb
topic_search_data.rb
topic_tag.rb
topic_thumbnail.rb
topic_timer.rb Minor follow-up bug fix for 5ff6c10. 2020-08-26 17:25:28 +08:00
topic_tracking_state.rb
topic_user.rb
topic_view_item.rb
topic.rb FIX: Ensure autoclose based on last post is executed by system user. 2020-08-26 12:08:46 +08:00
translation_override.rb
trust_level_and_staff_setting.rb
trust_level_setting.rb
trust_level3_requirements.rb PERF: Faster TL3 promotion replies needed calculation (#10416) 2020-08-12 11:28:34 -03:00
unsubscribe_key.rb
upload.rb DEV: Replace SECURE_MEDIA_ROUTE const with other methods (#10545) 2020-08-28 11:28:11 +10:00
user_action.rb FIX: UserAction did not have a types enum (#10553) 2020-08-28 11:49:19 -07:00
user_api_key.rb
user_archived_message.rb
user_associated_account.rb
user_auth_token_log.rb
user_auth_token.rb
user_avatar.rb
user_badge.rb
user_badges.rb
user_bookmark_list.rb
user_custom_field.rb Remove out-of-date / non-core annotations. 2020-09-01 12:40:57 +05:30
user_email.rb
user_export.rb
user_field_option.rb
user_field.rb
user_history.rb
user_open_id.rb
user_option.rb Update annotations. 2020-09-01 13:41:04 +05:30
user_profile_view.rb
user_profile.rb
user_search_data.rb
user_search.rb
user_second_factor.rb
user_security_key.rb
user_stat.rb PERF: Faster TL3 promotion replies needed calculation (#10416) 2020-08-12 11:28:34 -03:00
user_summary.rb
user_upload.rb
user_visit.rb
user_warning.rb
user.rb FIX: Gravatar download attempt if user is missing their email 2020-09-02 20:19:46 -06:00
username_validator.rb
watched_word.rb
web_crawler_request.rb
web_hook_event_type.rb
web_hook_event.rb
web_hook.rb