Commit graph

896 commits

Author SHA1 Message Date
Tom Hughes
0654be27f9 Fix new rubocop warnings 2021-01-11 19:17:31 +00:00
Tom Hughes
0ff89c31e4 Remove both Potlatch versions
Fixes #2622
2021-01-05 21:18:45 +00:00
Tom Hughes
384ac46102 Convert id column for oauth_nonces to bigint 2020-12-14 14:48:59 +00:00
Tom Hughes
88ba316abe Merge remote-tracking branch 'upstream/pull/2999' 2020-12-09 14:51:04 +00:00
Tom Hughes
bfffe7ed96 Prefer string interpolation to concatenation 2020-11-13 11:32:28 +00:00
Tom Hughes
582402ba8f Prefer keyword arguments when method has optional boolean arguments 2020-11-13 10:22:55 +00:00
Andy Allan
a65cb84288 Remove unused code 2020-11-11 16:43:58 +00:00
Tom Hughes
7db541d697 Invalidate existing sessions when changing email or password
As we don't have any way to actually find the active sessions for
an account we instead store a fingerprint in the session, and refuse
to use any session with a different fingerprint.
2020-09-29 14:34:08 +01:00
Tom Hughes
c694c78c9a Delete any outstanding tokens when a user changes their email
This ensures that any tokens previously sent to the old email address
can no longer be used if somebody were able to access that address.
2020-09-29 13:47:40 +01:00
Tom Hughes
18b9b9f14c Fix new rubocop warnings 2020-09-07 07:11:22 +01:00
Tom Hughes
c2af89c00e Fix rubocop Style/SoleNestedConditional warnings 2020-09-02 18:54:55 +01:00
Tom Hughes
b7432e9432 Handle new rubocop warnings 2020-09-02 07:18:21 +01:00
Tom Hughes
ea59d95f4a Fix some new rubocop warnings 2020-08-06 22:27:30 +01:00
Tom Hughes
0e2a66e8de Fix new rubocop warnings 2020-08-06 18:42:16 +01:00
Tom Hughes
2d3972249c Fix some rubocop todos 2020-08-02 19:38:58 +01:00
Tom Hughes
6c159b9673 Fix the Command Injection warnings from Brakeman 2020-07-31 15:54:06 +01:00
Tom Hughes
9f993fe8c8 Fix new rubocop warnings 2020-07-07 10:44:52 +01:00
Tom Hughes
3abeeb7f41 Require open3 before using it 2020-06-26 19:40:37 +01:00
Tom Hughes
39b60219fe Fix new rubocop warnings 2020-06-11 19:21:41 +01:00
Andy Allan
0a33c66146 Convert lib files to model concerns 2020-06-03 16:44:26 +02:00
Tom Hughes
7e925c3c00 Look at all note comments to find the close event
Fixes #2612
2020-05-06 14:06:04 +01:00
Andy Allan
32e46ad4e3 Remove tempfile patch for trace data
Effectively reverts c0d2ad40c3

This patch is no longer required, since we only use send_data in
combination with Tempfile.read and that all works fine.
2020-04-22 15:16:46 +02:00
Tom Hughes
64b3e289ac Merge remote-tracking branch 'upstream/pull/2597' 2020-04-22 13:34:19 +01:00
Andy Allan
35db86714b Use Open3.capture2 instead of backticks, to avoid command line injection risks
In this situation, trace_name can be trivially checked as legitimate, but this
removes any lingering risks from interpolating into a command line instead of
passing parameters explicitly.

Refs #2229
2020-04-22 13:57:32 +02:00
Andy Allan
a219df24ca Ensure that urls are only valid if the entire string is a url
This replaces our homegrown regexps (that didn't quite work) with
ruby built-in regexps, and uses the termination anchor to ensure
that the entire string, not just the first part, is validated.
2020-04-01 17:53:37 +02:00
Andy Allan
73c95847a6
Merge pull request #2485 from mmd-osm/patch/json2
JSON output nodes, ways, relations, map
2020-02-26 15:55:48 +01:00
Tom Hughes
7b0d3aaf9f Fix translation names 2020-01-09 11:00:46 +00:00
Tom Hughes
b1e1572af3 Don't validate the revoker for a block if it hasn't changed
The revoker only has to be a moderator at the time they make the
revocation - as things stood trying to view a block that had been
revoked by somebody that was no longer a moderator failed.
2020-01-09 10:59:34 +00:00
mmd-osm
b54333fa6d Unify lat/lon formatting for json output 2020-01-02 14:52:53 +01:00
Andy Allan
040302286f Remove ignoring of nearby column
This is the final stage in the process. Now that the migrations are run,
and apps restarted, it is safe to remove the ignore_column declaration.
2019-12-11 18:08:31 +01:00
Andy Allan
a41d500b9f Create an ApplicationRecord for models to inherit from
This is the default for Rails 5+, and also paves the way for
multiple database support.
2019-11-27 11:50:48 +01:00
Tom Hughes
6ec02bcdb2 Merge remote-tracking branch 'upstream/pull/2440' 2019-11-20 19:01:13 +00:00
Andy Allan
8ad88b9ddc Move user preference XML generation to a view 2019-11-20 16:39:23 +01:00
Andy Allan
bc850d1d37 Move Relation.to_xml and to_xml_node out of the model and into tests 2019-11-20 15:45:28 +01:00
Andy Allan
2b1bac1279 Move Way.to_xml and to_xml_node out of the model and into tests
This code is only used in the tests. Refs #2433
2019-11-20 15:31:47 +01:00
Tom Hughes
efcb56b68b Merge remote-tracking branch 'upstream/pull/2433' 2019-11-14 12:24:50 +00:00
Andy Allan
4e7c0c3008 Move Node.to_xml and to_xml_node out of model and into tests
This code is only used in the tests for creating 'fixture' payloads,
so it shouldn't be kept in the models.
2019-11-13 17:01:40 +01:00
Andy Allan
dd294f89b8 Ignore the users.nearby column
This is the first step of removing the column, see #2417. It needs to be
deployed before a migration to remove it, since the columns are
cached in ActiveRecord and things break if objects exist in memory
that expect the column to be there.
2019-11-13 14:19:32 +01:00
Tom Hughes
135ec35a91 Fix numericality validation to use correct integer only constraint
Fixes #2355
2019-08-22 12:14:06 +01:00
Tom Hughes
389fee0151 Revert "Always look to the global scope for the GPX module"
This reverts commit fbefe3550c.
2019-08-14 19:06:09 +01:00
Tom Hughes
8a39c6b4a2 Drop old user image columns 2019-07-17 19:12:30 +01:00
Andy Allan
0444187cb6 Update annotations after 91a37235ac 2019-07-17 10:39:10 +02:00
Tom Hughes
91a37235ac Remove support for old style user images 2019-07-16 22:33:26 +01:00
Tom Hughes
905a7eadb6 Defer deletion of avatars to a background job 2019-07-16 08:27:14 +01:00
Tom Hughes
6c202448ad Move user images to Active Storage with paperclip as a fallback 2019-07-09 19:17:30 +01:00
Tom Hughes
cbea796ef4 Merge remote-tracking branch 'upstream/pull/2207' 2019-06-26 14:30:30 +01:00
Tom Hughes
d2d5d48f29 Allow signups to be blocked by MX host 2019-06-23 11:21:03 +01:00
Andy Allan
d33b1f6b29 Pass the models, not the ids, when dealing with friendships 2019-06-19 16:56:31 +02:00
Andy Allan
2169c503ef Rename user.friend_users to user.friends
This is possible now since we've renamed Friend to Friendship
2019-06-19 16:51:35 +02:00
Andy Allan
1cf8fec58d Rename Friend model to Friendship
This better describes what the model represents, which is the relationship
between the two users.
2019-06-19 16:39:25 +02:00